//mailFrom > "KSeeSharp
//mailTo > Comma delimited email address(es)
//mailServer > Something like smtp.xyz.com
public bool SendEmail(string mailFrom, string mailTo, string subject, string message, string mailServer)
{
bool returnCode = false;
try
{
MailMessage msg = new MailMessage(mailFrom, mailTo, subject, message);
SmtpClient emailClient = new SmtpClient(mailServer);
emailClient.UseDefaultCredentials = true;
emailClient.Send(msg);
returnCode = true;
}
catch (Exception ex)
{
throw ex
}
return returnCode;
}
Works only with framework 2.0 and above...
ReplyDeletethanks man
ReplyDeleteHI
ReplyDeleteI want to setup contact info in my website using smtp client. First I want to test using localhost. Please let me know how to proceed further. How to setup email account for my localhost.
This is my email address: sarmatvs@yahoo.com.Please respond. Thanks in advance
HI KC
ReplyDeleteI have problem sending emails using SMTPclient.I have a application that sends out bulk emails.Problem is I get error after around 20 mails saying regarding Server Response.
Can u help on this
Lens
afcourse if they shrapness of a kknife were not to have seen it, thus obvoiusly would have made a plunge right through moistly soft flesh of the barefeet carressed once ago by teh fragrantic softness of petal flowers; would it they have not been?...
ReplyDelete