It is capable of doing so, but you will have to declare
the SMTP server. Tomas Vera touched on that in his
response, here's a snippet of code I use in a program to
send an email which works great.
/// <summary>
/// Sends an email using the SMTP service.
/// </summary>
/// <param name="sServer">SMTP server to send to</param>
/// <param name="sFrom">Email sending from</param>
/// <param name="sTo">Email sending to</param>
/// <param name="sSubject">Subject of the email</param>
/// <param name="sBody">Body of the email</param>
/// <returns>True if sent successfully, false if an error
occured</returns>
public bool SMTPSend(string sServer, string sFrom, string
sTo, string sSubject, string sBody)
{
try
{
// Build the MailMessage object
MailMessage oMessage = new MailMessage();
oMessage.From = sFrom;
oMessage.To = sTo;
oMessage.Subject = sSubject;
oMessage.Body = sBody;
// Set the SMTP server and send the
message.
SmtpMail.SmtpServer = sServer;
SmtpMail.Send(oMessage);
// If we got this far, it was sent
successfully.
return true;
}
catch
{
// An error occured, so return false
instead.
return false;
}
}
Hope this helps!
- Chris