I'm a noob at emailing from code and I need to add email capabilities to my
application.
The following code completes without exceptions but I'm not receiving any
test emails.
How do you debug this? Ive checked my bad mail folder, and other IIS similar
folders and they're empty.
Can the mail classes be used without having a SMTP server running on
localhost? Can you use any smtp server that's capable of being set up from a
PC, e.g. an ISP account?
If so, do you need to obtain the settings that you might find in an outlook
express email server tab?
Does the MailClient accept all the possible settings via properties?
Are there any recommended freeware/opensource SMTP server .net controls out
there that I could plug into my application so I don't have to require the
user to do any configuration?
thank you
Claire
public void SendEmail(strin g Sender, string Recipient, string Subject,
string Body)
{
string fnName = "SendEmail" ;
try
{
if (Sender == "") return;
if (Recipient == "") return;
System.Net.Mail .MailMessage Message = new
System.Net.Mail .MailMessage(Se nder,Recipient, Subject,Body);
System.Net.Mail .SmtpClient MailClient = new System.Net.Mail .SmtpClient();
MailClient.Host = "LocalHost" ;
MailClient.Send (Message);
}
catch (Exception e)
{
LogException(fn Name, e);
throw e;
}
}// function