コード例 #1
0
        public async Task <string> SendEmailAsync(string to, string subject, string body, EmailType type, string from = "*****@*****.**")
        {
            requestBody         = new ServiceReferenceSMTP.SendRequestBody();
            requestBody.msgTo   = to;
            requestBody.msgFrom = from;



            requestBody.msgBody = GetTemplate(type, body);

            requestBody.msgSubject = subject;
            ServiceReferenceSMTP.SendRequest sendRequest = new ServiceReferenceSMTP.SendRequest(requestBody);

            soap = new ServiceReferenceSMTP.SMTPSoapClient(new EndpointConfiguration());

            var result = await soap.SendAsync(sendRequest);

            return(result.Body.SendResult);
        }
コード例 #2
0
 public SendRequest(ServiceReferenceSMTP.SendRequestBody Body)
 {
     this.Body = Body;
 }