plzz write a simple function on..........
-
-
There you go, enjoy :) ============================================= using System.Net.Mail; public static void SendMailMessage(string sMailBody, string sFromAddress, string sFromName, string[] sToAddress, string[] sCC, string[] sBCC, string sSubject, bool IsHTML) { SmtpClient objSMTPClient = new SmtpClient("localhost"); MailMessage objMessage = new MailMessage(); try { MailAddress objFromAddress = new MailAddress(sFromAddress, sFromName); // From address will be given as a MailAddress Object objMessage.From = objFromAddress; // To address collection of MailAddress for (int i = 1; i <= sToAddress.Length; i++) { objMessage.To.Add(sToAddress[i - 1]); } // CC and BCC optional // MailAddressCollection class is used to send the email to various users // You can specify Address as new MailAddress("user@host.com") if (sCC != null) { if (sCC.Length > 0) { for (int i = 1; i <= sCC.Length; i++) { objMessage.CC.Add(sCC[i - 1]); } } } if (sBCC != null) { if (sBCC.Length > 0) { for (int i = 1; i <= sBCC.Length; i++) { objMessage.Bcc.Add(sBCC[i - 1]); } } } // Body can be html or text format if (IsHTML) objMessage.IsBodyHtml = true; objMessage.Subject = sSubject; objMessage.Body = sMailBody; // Send SMTP mail objSMTPClient.Send(objMessage); } catch { } } My blog: http://www.asaf.co.il
-
There you go, enjoy :) ============================================= using System.Net.Mail; public static void SendMailMessage(string sMailBody, string sFromAddress, string sFromName, string[] sToAddress, string[] sCC, string[] sBCC, string sSubject, bool IsHTML) { SmtpClient objSMTPClient = new SmtpClient("localhost"); MailMessage objMessage = new MailMessage(); try { MailAddress objFromAddress = new MailAddress(sFromAddress, sFromName); // From address will be given as a MailAddress Object objMessage.From = objFromAddress; // To address collection of MailAddress for (int i = 1; i <= sToAddress.Length; i++) { objMessage.To.Add(sToAddress[i - 1]); } // CC and BCC optional // MailAddressCollection class is used to send the email to various users // You can specify Address as new MailAddress("user@host.com") if (sCC != null) { if (sCC.Length > 0) { for (int i = 1; i <= sCC.Length; i++) { objMessage.CC.Add(sCC[i - 1]); } } } if (sBCC != null) { if (sBCC.Length > 0) { for (int i = 1; i <= sBCC.Length; i++) { objMessage.Bcc.Add(sBCC[i - 1]); } } } // Body can be html or text format if (IsHTML) objMessage.IsBodyHtml = true; objMessage.Subject = sSubject; objMessage.Body = sMailBody; // Send SMTP mail objSMTPClient.Send(objMessage); } catch { } } My blog: http://www.asaf.co.il
You took all the fun out of having him do the research and actually LEARN something. ;P
only two letters away from being an asset
-
You took all the fun out of having him do the research and actually LEARN something. ;P
only two letters away from being an asset
He can learn a lot from the code snippest... (At least I hope :doh: )
-
He can learn a lot from the code snippest... (At least I hope :doh: )
He'll learn to copy and paste
only two letters away from being an asset
-
hi refer this link; http://www.codeproject.com/aspnet/SivaEMailSample.asp[^] regards saravanan
-
ednrgc wrote:
Ok, I finished it. Now what?
:laugh:
Upcoming Scottish Developers events: * Glasgow: Tell us what you want to see in 2007 My: Website | Blog | Photos
-
He'll learn to copy and paste
only two letters away from being an asset