I got error "Cannot implicitly convert type 'string' to 'System.Net.Mail.MailAddress' "
MailMessage msg = new MailMessage();
msg.From = "info@xxx.com";
msg.To = "comments@xx.com";
msg.Bcc = "keith@xxx.com";
msg.Subject = "Comment";
msg.Body = "Comment: xxxxxxx xxxxxxx xxxxxxx ";
SmtpClient smtpClient = new SmtpClient();
smtpClient.Host = Global.smtp;
To solve the issue, i change to below code
MailMessage msg = new MailMessage();
msg.From = new System.Net.Mail.MailAddress("info@xxx.com");
msg.To.Add("comments@xx.com");
msg.Bcc.Add("keith@xxx.com");
msg.Subject = "Comment"; msg.Body = "Comment: xxxxxxx xxxxxxx xxxxxxx ";
SmtpClient smtpClient = new SmtpClient();
smtpClient.Host = Global.smtp;
5 comments:
You may have to try to use System.web.**** as i did on a Server which i am NOT allowed to update the version of the .Net Framework...
HTH
JAaronAnderson.com
Took me time to read the whole article, the article is great but the comments bring more brainstorm ideas, thanks.
- Johnson
Thanks, that worked perfectly
Thnks Buddy its WORKSSS...
many many Thnks Buddy its WORKSss
Post a Comment