hi,

i'm currently doing my major project in school. i'm doing c# programming and i am stuck at the registration part.
i'm supposed to send an email with an unique and randon activation code to the users to verify their account.

MailMessage m = new MailMessage();
m.From = new MailAddress("[email protected]", "Shannelle-administrator");
m.To = new MailAddress(tbxEmail.Text);
m.Subject = "McDonald's delivery - Verify your Account now";
m.BodyEncoding = System.Text.Encoding.UTF8;
m.Body = "Thanks for registering with us! " + "/n"
+ "Please note that you must complete this last step to become a registered member" + "/n"
+ "To complete your registration, please visit this url: " + "/n"
+ "http://localhost:3130/MP%20web/Registration_VerifyAcct.aspx" + "/n"
+ "Your username is: " + tbxNickname + "/n"
+ "Your activation code is: 00001 " ;
m.Priority = MailPriority.Normal;
try
{
// SmtpMail class
SmtpClient client = new SmtpClient();
client.Send(m);
}
catch (Exception ex)
{
Label1.Text = "SQL Error: " + ex.Message;
}

But i've some errors at the m.To line. the error says "Property or Indexer 'System.Net.Mail.MailMessage.To' cannot be assigned to -- it is read only"

the other error says Cannot implicitly convert type System.Net.Mail.MailAddress' to 'System.Net.Mail.MailCollection'
this error is refering to the word new after m.To

i would appreciate it if someone could provide me with the code. im really desperate for it now ):

and also, if im using localhost, how am i supposed to test it, if there's no IIS installed?

thanks alot (:

cheers,
shannelle