Problems with ASP.Net and GMail

  • Thread starter Thread starter ClickList
  • Start date Start date
C

ClickList

Hello Friends

I'm using the follow code in my website to send/receive e-mails:
SmtpClient smtp = new SmtpClient("smtp.gmail.com", 587);

smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
smtp.EnableSsl = true;
smtp.UseDefaultCredentials = false;
smtp.Credentials = new
System.Net.NetworkCredential("(e-mail address removed)", "MySecretPassword");

MailMessage message = new MailMessage();
message.Subject = "etc etc etc";
message.Body = "etc etc etc";

message.From = new MailAddress("(e-mail address removed)");
message.To.Add(new MailAddress("(e-mail address removed)")); // ATTENTION HERE

smtp.Send(message);

In MailMessage.To, I place myself mail, and works very fine when I
receive feedbacks in the site. But I wish use the same code to send
e-mail to another persons, (like password reminders). The code works
fine, none exceptios are throwed but the mail is not received!!! What's
wrong? Someone can help me?
 
I have a gmail example in both 1.1 and 2.0 at my blog

spaces.msn.com/sholliday/

just search for "smtp".
 
Back
Top