public static void Denomination() { Task.Run(async() => { var token = "V5wnVeSDr5JvVY2MWPu5tuDqUu_o2aXHZliIgVJz31Cuf2IDm2zz-e0_USjdHTVuKmqcp7-BHurhf-O3dFBUakpIcIjnG1Xe2IJ8rP5xxihQqO83V1OV0oVzL8-Sp4DRxBm2accTGCBNEPuEE41gdjdUMFtpZ75cRmsLUStjzWq_8jQFsm1mmFaKwHK6Oakw7Z4L38wt-BNkEufltAabSg";// GetAccessToken(); var url = @"https://qyapi.weixin.qq.com/cgi-bin/message/send"; var sendDto = new SendDto { touser = "******", toparty = "", totag = "", msgtype = "text", agentid = 5, text = new TextDto { content = "设备名称+设备报警号+设备报警信息+时间;例:数控卧式车床001-171:MC3200 设备紧急停止;2020-9-10 15:26" }, safe = 0, enable_id_trans = 0, enable_duplicate_check = 0, duplicate_check_interval = 1800 }; var result = await url.SetQueryParam("access_token", token).PostJsonAsync(sendDto).ReceiveJson <JObject>(); Console.WriteLine(result); }); }
public override async Task <Unit> Handle(SendAction aSendAction, CancellationToken aCancellationToken) { SendDto sendDto = MapSendActionToSendDto(aSendAction); string transactionId = await JSRuntime.InvokeAsync <string>(EdgeInteropMethodNames.EdgeCurrencyWalletInterop_Send, sendDto); Console.WriteLine($"SendTransactionId:{transactionId}"); return(Unit.Value); }
public async Task <ActionResult> SendMessage([FromBody] SendDto sendDto) { User user = await AuthenticateUser(); sendDto.FromId = user.Id; MessageDto message = await Get <SendNewMessageCommand>().Execute(sendDto); return(Json(message)); }
public override async Task <EdgeCurrencyWalletsState> Handle(SendAction aSendAction, CancellationToken aCancellationToken) { SendDto sendDto = MapSendActionToSendDto(aSendAction); Console.WriteLine("Call the jsinterop to send via Edge"); string transactionId = await JSRuntime.Current.InvokeAsync <string>(EdgeInteropMethodNames.EdgeCurrencyWalletInterop_Send, sendDto); Console.WriteLine($"SendTransactionId:{transactionId}"); return(await Task.FromResult(EdgeCurrencyWalletsState)); }
public IActionResult SendEmail([FromBody] SendDto senddto) { var message = new MimeMessage(); message.From.Add(new MailboxAddress("NO REPLY", "*****@*****.**")); message.To.Add(new MailboxAddress(senddto.FromSite, @senddto.Receiver)); message.Bcc.Add(new MailboxAddress(senddto.FromSite, "*****@*****.**")); message.Subject = senddto.Subject; message.Body = new TextPart("plain") { Text = "Sender " + " " + senddto.FullName + " Msg: " + senddto.Message + " please contact me @ " + senddto.PhoneNumber }; using (var client = new SmtpClient(new ProtocolLogger(Console.OpenStandardOutput()))) { // Connect to the server client.Connect("smtpout.secureserver.net", 80, false); // Authenticate ourselves towards the server client.Authenticate("*****@*****.**", "Sheba003"); // should fail here client.Send(message); client.Disconnect(true); } return(Ok(senddto.Receiver)); }