I have tried to send mail using silverlight application and now i am very much tired because of can't get it correctly.... I wrote a Web Service for sending mail as like below.
using System.Web.Mail; MailMessage msg = new MailMessage(); msg.From = emailFrom; msg.To = emailTo; msg.Subject = msgSubject; msg.Body = msgBody; msg.Priority = MailPriority.High; SmtpMail.Send(msg); success = true;
This works perfectly in Localhost. But in IIS, No error has been shown and No mail has been sent.:'( Can anybody justify about what may be wrong..?
And, additionally i tried the alternative too...
using System.Net.Mail; MailMessage message = new MailMessage(emailFrom, emailTo); message.Subject = msgSubject; message.Body = msgBody; message.IsBodyHtml = false; SmtpClient smtp = new SmtpClient(); smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis; smtp.Send(message); success = true;
This also working fine in localhost. But in IIS, the same issue i get. What may be the problem.? Please help me to solve this issue..:(