public static bool SendAdInEmail(int adId, string senderName, string senderAddress, string recipientEmail, string subject, string message)
{
bool sent = false;
string from = String.Format("{0} <{1}>", senderName, senderAddress);
try
{
MailMessage m = new MailMessage(from, recipientEmail);
m.Subject = subject;
m.Body = message;
SmtpClient client = new SmtpClient();
client.Send(m);
sent = true;
}
catch
{
// Consider customizing the message for the EmailNotSentPanel in the ShowAds page.
sent = false;
}
return sent;
}