Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old August 2nd, 2013, 03:33 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default Still having SMTP issues.

When I deployed your application that was shaped into an E-Commerce candy store application the SMTP email notifications were totally hosing out. Finally the web hosting company got back to me and told me that the reason for this happening was in their words:

Unfortunately it looks like your application does not have SMTP authentication enabled or written in to the application. This is required on on our servers to send the mail out. We can not remove this requirement as it is a security hole that could possibly affect many other accounts on the server.

Is there anywhere in the book that talks about what you have to do put in SMTP authentication?

This is what the web hosting people told me that I need to do:

Code:
Nowadays, you need to enable SMTP authentication for all emails send from your hosting account. It is easy to enable SMTP in case if you make use of e-mail clients such as Outlook. However, you should provide the required authentication code if you attempt to send an e-mail through ASP.NET web form.

ASP.NET 4.5 has simplified the process of SMTP authentication when compared to prior versions, which make use of CDO object.

(1) You need to create an object of smtpClient() and pass the required mail server as parameter

Dim smtp As New SmtpClient(“mail.abcd.com”)

(2) Pass your mail account username and password to NetworkCredential() object

smtp.Credentials = New NetworkCredential(“mails@abcd.com”, “Your Password”)

You have to replace the domain – abcd.com and Your Password with your correct credentials.

Your emails will now be authenticated.

- See more at: http://blog.arvixe.com/how-do-i-authenticate-emails-in-asp-net-using-smtp/#sthash.9Qzqheqr.dpuf
Is there anyway to put this into the application that comes with the book to satisfy this ridiculous annal retentive requirement???!!!!
Reply With Quote
  #2 (permalink)  
Old August 3rd, 2013, 06:51 AM
Imar's Avatar
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

Quote:
this ridiculous annal retentive requirement?
It's not. By requiring you to supply a user name and password your host can prevent spammers from sending spam through their servers. I am sure you hate spam as much as I do, so you should consider this a good thing.

The section I referred to in an earlier post (Chapter 9, page 334) has the details on how to configure web.config to supply a user name and password and other details needed to connect to their mail server.

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!
Reply With Quote
  #3 (permalink)  
Old August 3rd, 2013, 09:43 AM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default

Quote:
Originally Posted by Imar View Post
It's not. By requiring you to supply a user name and password your host can prevent spammers from sending spam through their servers. I am sure you hate spam as much as I do, so you should consider this a good thing.

The section I referred to in an earlier post (Chapter 9, page 334) has the details on how to configure web.config to supply a user name and password and other details needed to connect to their mail server.

Cheers,

Imar
I have my web.config file configured for SMTP set up just like you have it on page 335 of the book using my Gmail account with userId and Password and even still they want to hose out me from sending emails from their server accounts because they want me to write code with a class objects in C# that has my network credentials of my network Id and password instantiated in a class object inside the code of each webpage or web form that has all of this in it by gathering my local network credentials before I can send out an email or use SMTP server. Putting my userId and password for my GMail account into my web.config file is not an issue but having to write a bunch more of additional code to instantiate C# network objects with my local network credentials like my userId and Password that I use to authenticate or logon to their servers before I can access my Gmail account that has nothing to do with them, is in my opinion, way beyond being outrageous.
Reply With Quote
  #4 (permalink)  
Old August 3rd, 2013, 11:42 AM
Imar's Avatar
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 don't know your host so I could be wrong, but I think you have misunderstood their instructions or they aren't very good at supplying the right information.

You should be able to specify your account name and password directly into the web.config file, along with their SMTP server. This means you don't use (nor need) Gmail to send the e-mails.

Have you tried that?

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!
Reply With Quote
  #5 (permalink)  
Old August 3rd, 2013, 01:03 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default

Quote:
Originally Posted by Imar View Post
I don't know your host so I could be wrong, but I think you have misunderstood their instructions or they aren't very good at supplying the right information.

You should be able to specify your account name and password directly into the web.config file, along with their SMTP server. This means you don't use (nor need) Gmail to send the e-mails.

Have you tried that?

Cheers,

Imar
Is there a place in your book that shows how to do that? I can't seem to find it anywhere.
Reply With Quote
  #6 (permalink)  
Old August 3rd, 2013, 01:33 PM
Imar's Avatar
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

In the section I've been referring to a few times now.

BTW: you fell in your old habit of quoting the entire message; there's no need for that as the entire thread is always visible on this page.

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!
Reply With Quote
  #7 (permalink)  
Old August 3rd, 2013, 03:04 PM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default If I am not mistaken

What you are referring to is the SMTP stuff. I need to know about your network credentials like when you sign on to your hosting server with UserId and Password. Not the SMTP credentials for email server account.
Reply With Quote
  #8 (permalink)  
Old August 4th, 2013, 06:40 AM
Imar's Avatar
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

Have you tried it out? This *is* about SMTP stuff. The network credentials from the code example are used to authenticate against the SMTP server. By specifying them in web.config they serve the same purpose as in the code example: allow the account to use the SMTP server.

You should drop your Gmail related stuff and configure web.config to use your host's mail server and credentials they supply. There should be no need to write this custom code (and it wouldn't work well for scenarios where ASP.NET sends out e-mail automatically).

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!

Last edited by Imar; August 6th, 2013 at 10:47 AM..
Reply With Quote
  #9 (permalink)  
Old August 6th, 2013, 10:20 AM
Friend of Wrox
Points: 1,905, Level: 17
Points: 1,905, Level: 17 Points: 1,905, Level: 17 Points: 1,905, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2011
Posts: 411
Thanks: 13
Thanked 7 Times in 7 Posts
Default It now works!

I sent your suggestion into the webhosting company and now for the most part everything seems to be working except for the signup.aspx page. For some reason or another it is still hosing out on us. Other than that it works really good.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Smtp teddyk ASP.NET 2.0 Basics 5 November 1st, 2008 03:46 PM
connection string issues, web.config file issues kaliaparijat ASP.NET 2.0 Professional 1 June 12th, 2008 08:07 AM
SMTP problem hastikeyvan ASP.NET 2.0 Professional 3 August 10th, 2006 01:40 AM
Help on C#/SMTP peri C# 2 December 6th, 2004 10:43 PM
About SMTP abdul_owiusa C# 2 August 6th, 2004 06:12 AM



All times are GMT -4. The time now is 07:23 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.