| Код | [WebMethod] public bool SendMailF(string fromAddress,string toAddress,string subject, string body) { try { MailMessage msg = new MailMessage(); msg.From = new MailAddress(fromAddress); msg.To.Add(new MailAddress(toAddress)); msg.Subject = subject; msg.Body = body; msg.IsBodyHtml = false;
SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587); smtp.Credentials = new NetworkCredential("petr3593", "777777777777"); smtp.EnableSsl = true; smtp.Send(msg); return true; } catch (Exception ex) { return false; } }
|
вот метод в файле веб сервиса, когда я этот метод вызываю, то письмо не отправляется (( Вот вызов из silverlight app: | Код | BasicHttpBinding bind = new BasicHttpBinding(); EndpointAddress endpoint = new EndpointAddress("http://glebati.studenthost.ru/SendMail.asmx"); ServiceProxy.SendMailSoapClient mailSrv = new ServiceProxy.SendMailSoapClient(bind, endpoint); mailSrv.SendMailFAsync("[email protected]", "[email protected]", "Subj", "Body");
|
|