View Single Post
  #4 (permalink)  
Old June 15th, 2012, 02:36 AM
Imar's Avatar
Imar Imar is offline
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

I agree with Ian: the code you commented out should work. A few things to check:

1. Use your full Gmail user name. That is, not userName, but userName@gmail.com

2. Make sure your network is allowed to reach smtp.gmail.com over port 587. Maybe your network administrator doesn't allow traffic to go over that port?

3. Take a look at this:

from="<myemail>"

The from attribute should contain at least a valid e-mail address; not just your name. This means you need to remove the < and > symbols.

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote