how to use webservice for sending email

Posted by Raj_Chennai under Others on 3/15/2012 | Points: 10 | Views : 1247 | Status : [Member] | Replies : 5
how to use webservice for sending email . provide code for sending email in webservice as well as how to call that web method and use in design page of website

raj


Responses

Posted by: CGN007 on: 3/15/2012 [Member] Silver | Points: 25

Up
0
Down
Please refer this link
http://www.codeproject.com/Articles/6031/A-NET-web-service-for-e-mail


Raj_Chennai, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Hmanjarawala on: 3/15/2012 [Member] Bronze | Points: 25

Up
0
Down
Hi, try this one:
http://www.codeproject.com/Articles/30758/Email-Sending-Web-Service
http://yasserzaid.wordpress.com/2010/08/02/send-email-using-webservice/

Himanshu Manjarawala
Sr. Software Engineer@AutomationAnywhere
http://fieredotnet.wordpress.com/

Raj_Chennai, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Raj_Chennai on: 3/15/2012 [Member] Starter | Points: 25

Up
0
Down
hi,
thank you

raj

Raj_Chennai, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sksamantaray on: 3/15/2012 [Member] Silver | Points: 25

Up
0
Down

Follow these steps
1.Create a webmethod :

[WebMethod]
public bool SendMail(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 = true;
SmtpClient smtp = new SmtpClient("127.0.0.1"); //replace with your smtp client
smtp.Send(msg);
return true;
}
catch(Exception exp)
{
return false;
}
}

2.Host this in a Remote Server
3.Create a Local Application
4.Add WebReference
5.Call Remote WebMethod and pass Required Parameters.
6.Thats it your mail is sent.

Thanks,
Sanjay

Raj_Chennai, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: CGN007 on: 6/29/2012 [Member] Silver | Points: 25

Up
0
Down
Mark as Answer if it helpful to you,that motivates...

Raj_Chennai, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response