Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 7th, 2010, 08:32 PM
Registered User
 
Join Date: Sep 2010
Posts: 5
Thanks: 4
Thanked 1 Time in 1 Post
Default Chapter 9 Email not going through

Using my gmail account, I put the code in properly and Im not getting any errors, the page comes up fine, but there are no emails that are going though. I tried all your troubleshooting tips. Im getting an error on this line, it just says failure sending mail:

Code:
mySmtpClient.Send(myMessage);
Here my web.config (I put user/pass in asterisks just so its not out in the web):

Code:
<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
	<system.web>
    <pages theme="Monochrome">
      <controls>
        <add tagPrefix="Wrox" tagName="Banner" src="~/Controls/Banner.ascx"/>
      </controls>
    </pages>
		<compilation debug="true" targetFramework="4.0"/>
	</system.web>
  <system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from ="Dan L &lt;***@gmail.com&gt;">
        <network enableSsl ="true" userName="***@gmail.com" password="****" host="smtp.gmail.com"/>
      </smtp>
    </mailSettings>
  </system.net>
</configuration>

Last edited by dtmmaxx; October 7th, 2010 at 08:36 PM..
 
Old October 8th, 2010, 02:53 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Have you tried setting the port number to 587 in the web.config? It's an attribute on the network element you posted.

Cheers,

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!
The Following User Says Thank You to Imar For This Useful Post:
dtmmaxx (October 11th, 2010)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 9 Trying to send email out digink BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 6 March 5th, 2011 05:42 AM
Chapter 9 Email problem Dariune BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 23 December 4th, 2010 01:54 PM
Chapter 9 Can't send email ChuckASP BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 April 22nd, 2010 12:16 PM
Chapter 9 - email security ChuckASP BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 March 20th, 2010 03:26 PM
Chapter 3 - Email List daibhidh BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 6 December 4th, 2009 06:39 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.