How to send Email with/without attachments using WCF Service
Aug 17, 2013 06:09 AM|Amarnath Balasubramanian|LINK
Hi ,
I am newbie to wcf service can anyone help me from the scratch to send mail using wcf service. i have googled it but i can't get the clear concept of this. Please help me out.
Re: How to send Email with/without attachments using WCF Service
Aug 19, 2013 02:17 AM|Amarnath Balasubramanian|LINK
Thank you so much for the tutorial.
if i need to change the client application to web form then should i need to make changes in the wcf service.
Because i need to mention the recepient email address, subject and body of the message at the runtime. please clarify me in this. thank you so much in advance.
change the client application to web form then should i need to make changes in the wcf service.
No.
The service is providing the required functionality. Refer the below
public int SendEmail(string gmailUserAddress, string gmailUserPassword, string[] emailTo,
string[] ccTo, string subject, string body, bool isBodyHtml, FileAttachment[] attachments)
{
Amarnath Balasubramanian
need to mention the recepient email address, subject and body of the message at the runtime.
As long as the existing web service is providing the operation (function) there is
no need to change the service. Web form application simply consumes the service by providing the required parameters to the service. In the suggested article the client is windows console application, in your requirement it is 'web forms'.
Note: Please post a new thread for further response.
Member
10 Points
31 Posts
How to send Email with/without attachments using WCF Service
Aug 17, 2013 06:09 AM|Amarnath Balasubramanian|LINK
Hi ,
I am newbie to wcf service can anyone help me from the scratch to send mail using wcf service. i have googled it but i can't get the clear concept of this. Please help me out.
Thank you so much in advance..!!
Attachments wcfservice sendmails
{
experience++;
}
Member
84 Points
106 Posts
Re: How to send Email with/without attachments using WCF Service
Aug 17, 2013 07:09 AM|sarvesh.mca@hotmail.com|LINK
Hi Amarnath,
public static void sendMail(string to, string from, string subject, string body)
{
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(from, to);
msg.Subject = subject;
msg.IsBodyHtml = true;
msg.Body = body;
msg.IsBodyHtml = true;
System.Net.Mail.SmtpClient oSmtpClient = new System.Net.Mail.SmtpClient("localhost");
oSmtpClient.Send(msg);
}
Attachments wcfservice sendmails
Member
84 Points
106 Posts
Re: How to send Email with/without attachments using WCF Service
Aug 17, 2013 07:11 AM|sarvesh.mca@hotmail.com|LINK
Or,
private void sendErrorEmail(string sub, string errormsg)
{
string from = "abc@gmail.com";
string to = "xyz@gmail.com";
System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage(from, to);
msg.Subject = sub;
msg.IsBodyHtml = true;
msg.Body = errormsg;
System.Net.Mail.SmtpClient oSmtpClient = new System.Net.Mail.SmtpClient("localhost");
oSmtpClient.Send(msg);
}
Attachments wcfservice sendmails
Star
13042 Points
3174 Posts
Re: How to send Email with/without attachments using WCF Service
Aug 17, 2013 11:17 AM|sukumarraju|LINK
Step by step tutorial : WCF Service to send Email with attachments
Let us know further queries.
Attachments wcfservice sendmails
Application Architecture Guide 2.0
My Blog
Twitter
Member
10 Points
31 Posts
Re: How to send Email with/without attachments using WCF Service
Aug 19, 2013 02:17 AM|Amarnath Balasubramanian|LINK
Thank you so much for the tutorial.
if i need to change the client application to web form then should i need to make changes in the wcf service.
Because i need to mention the recepient email address, subject and body of the message at the runtime. please clarify me in this. thank you so much in advance.
Attachments wcfservice sendmails
{
experience++;
}
Star
13042 Points
3174 Posts
Re: How to send Email with/without attachments using WCF Service
Aug 19, 2013 05:50 AM|sukumarraju|LINK
No.
The service is providing the required functionality. Refer the below
As long as the existing web service is providing the operation (function) there is no need to change the service. Web form application simply consumes the service by providing the required parameters to the service. In the suggested article the client is windows console application, in your requirement it is 'web forms'.
Note: Please post a new thread for further response.
Attachments wcfservice sendmails
Application Architecture Guide 2.0
My Blog
Twitter