System.Net.Mail.SmtpClient MailClient message. How do u know if it was successful?

Tech-Archive recommends: Fix windows errors by optimizing your registry



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(string 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(Sender,Recipient,Subject,Body);
System.Net.Mail.SmtpClient MailClient = new System.Net.Mail.SmtpClient();
MailClient.Host = "LocalHost";
MailClient.Send(Message);
}
catch (Exception e)
{
LogException(fnName, e);
throw e;
}
}// function


.



Relevant Pages

  • Re: System.Net.Mail.SmtpClient MailClient message. How do u know if it was successful?
    ... The following code completes without exceptions but I'm not receiving any ... Yes just set host to the FQDN of the smtp server. ... public void SendEmail(string Sender, string Recipient, string Subject, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Problem with CDO.configuration
    ... I am sending mail from my apps with CDO nowadays. ... Private Const cdoSendUsingPort = 2 'Send the message using the network. ... Public Function sendCDO_Mail(sTo As String, sSubject As String, sMsg As String) As Boolean ... ' Name or IP of Remote SMTP Server ...
    (comp.databases.ms-access)
  • Re: Question concerning object-oriented programming
    ... If at the end of the constructor the ... return defaults such as zero, a null string, or null. ... can also throw exceptions from methods. ... toString() in there. ...
    (comp.programming)
  • Re: Control = StrConv([Control], 3)
    ... Scott ... >> Fred- I think a list of exceptions would be best, I can only see a handful ... > Function ConvExceptionsInField(StrIn As String) As String ... > Dim strWord As String ...
    (microsoft.public.access.formscoding)
  • Re: Java 7 features
    ... indeed, get rid of checked exceptions, by making ... String foo = whatever; ... The example above explicitly initializes the String foo. ...
    (comp.lang.java.programmer)