public void SendMessage() { IAppConfig appConfig = new MessageConfig("appid", "appkey", SignType.md5); MessageSend messageSend = new MessageSend(appConfig); messageSend.AddTo("17602115149"); messageSend.AddContent("【SUBMAIL】你好,你的验证码是:11112"); messageSend.AddTag("111111112"); string returnMessage = string.Empty; messageSend.Send(out returnMessage); Console.WriteLine(returnMessage); Console.ReadKey(); }
public void Message() { var TeacherList = yuan.PhoneList(); string returnMessage = string.Empty; foreach (var item in TeacherList) { IAppConfig appConfig = new MessageConfig("26920", "d22f4cccf0441fcafcab541dd7d6e646", SignType.md5); MessageSend messageSend = new MessageSend(appConfig); messageSend.AddTo(item.Phone); messageSend.AddContent("【智联科技有限公司】尊敬的" + item.Name + "(先生),本周的课表已出,请去官网or手机端进行查看。生话愉快。"); messageSend.AddTag("xxxxx"); messageSend.Send(out returnMessage); } }
public ActionResult Message2() { var TeacherList = yuan.PhoneList(); string returnMessage = string.Empty; foreach (var item in TeacherList) { IAppConfig appConfig = new MessageConfig("26920", "d22f4cccf0441fcafcab541dd7d6e646", SignType.md5); MessageSend messageSend = new MessageSend(appConfig); messageSend.AddTo(item.Phone); messageSend.AddContent("【智联科技有限公司】尊敬的" + item.Name + "(先生),本周的课表已修改,请去官网,140.143.54.130,or手机端,140.143.54.130:100进行查看。生话愉快。"); messageSend.AddTag("xxxxx"); messageSend.Send(out returnMessage); } return(Json(new { errorNo = "0", errorInfo = returnMessage }, JsonRequestBehavior.AllowGet)); }
public ObjectResult SendCodeAsync([FromBody] MessageCodeInputDto input) { _logger.LogInformation($"client[post]:发送短信验证码{input.code}给{input.molile}"); IAppConfig appConfig = new MMSConfig("41014", "1c5485f03799ecb37c5d1d00b66523f6", SignType.normal); MessageSend messageSend = new MessageSend(appConfig); messageSend.AddTo(input.molile); messageSend.AddContent($"【每日币推】您的验证码是:{input.code},请在10分钟内输入"); messageSend.AddTag("123"); string returnMessage = string.Empty; messageSend.Send(out returnMessage); var command = new MessageAddCommand(input.code, input.code, BlockSms.Core.Domain.EMsgType.验证码); var result = _mediator.Send(command); return(Ok(result)); }
//课表完成发送的action public ActionResult SendMessage(string PhoneNumber) { IAppConfig appConfig = new MessageConfig("26920", "d22f4cccf0441fcafcab541dd7d6e646", SignType.md5); MessageSend messageSend = new MessageSend(appConfig); messageSend.AddTo(PhoneNumber); string temp = ""; Random random = new Random(); for (int i = 0; i < 6; i++) { temp += random.Next(1, 9).ToString(); } DateTime date = DateTime.Now; messageSend.AddContent("【智联科技有限公司】你的验证码为" + temp + ",请在一分钟内进行输入。"); messageSend.AddTag("xxxxx"); string returnMessage = string.Empty; messageSend.Send(out returnMessage); return(Json(new { Count = 1, Message = returnMessage, Number = temp }, JsonRequestBehavior.AllowGet)); }