I wrote the following email program for sending email. However after running the following email program, I still could not see that received email from my email account. Where is the problem Please help.
John Wen
5 - July - 07
=====================================================
using System;
using System.Net.Mail;
public class myemail_send
{
public static void Main(string[] args)
{
try
{
MailAddress maFrm = new MailAddress("johnwen604@yahoo.com.hk",args[0],System.Text.Encoding.UTF8);
MailAddress maTo = new MailAddress("johnwen604@yahoo.com.hk");
MailMessage message = new MailMessage(maFrm, maTo);
message.Subject = "Hi how are u ";
message.Body = "hi I am a boy and you are a girl. I hope you are well. Bye! Bye!";
SmtpClient client = new SmtpClient(args[1]);
client.Send(message);
} catch (IndexOutOfRangeException e)
{
Console.WriteLine("Usage : send <sender name> <SMTP Server>");
}
}
}
=================================================================