Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 May 13th, 2010, 07:14 AM
Friend of Wrox
 
Join Date: Sep 2009
Posts: 165
Thanks: 5
Thanked 6 Times in 6 Posts
Default Struggling With Email

Hello Imar,
Once again I am struggling with emails.
14 days ago all emails were being delivered without any error, but now none of the email is delivered neither from local site nor from hosted site.
I did not change any single letter of code in web.config and in pages.

Web config file is as follows.
Code:
<appSettings>
<add key="MailFromAddress" value="<user name>@gmail.com"/>
<add key="MailToAddress" value="<user name>@gmail.com"/>
<add key="SenderName" value="Jack"/>
<add key="ReceiverName" value="Jack"/>
<add key="SendMailOnError" value="true"/>
</appSettings>
and under system net
Code:
<system.net>
<mailSettings>
<smtp from="Jack &lt;<user name>@gmail.com&gt;" deliveryMethod="Network">
<network host="smtp.gmail.com" userName="<user name>" password="<password>" port="587" />
</smtp>
</mailSettings>
</system.net>
And the page that sends message is as follows

Code:
myMessage.From = New MailAddress(AppConfiguration.MailFromAddress, AppConfiguration.SenderName)
myMessage.To.Add(New MailAddress(AppConfiguration.MailToAddress, AppConfiguration.ReceiverName))

Dim mySmtpClient As New SmtpClient()
Try
        mySmtpClient.EnableSsl = True
        mySmtpClient.Send(myMessage)
Catch ex As Exception
        lblMessage.Text = "I Apologize, An Error Occurred While Sending Your Message. Please Try Again."
End Try
On debugging it always fires the catch block. Earlier I never had such problem with emails but for last few days none of the email is being delivered.
Is it my system problem?
Is it any port no. issue? My local site and remote site are not delivering any message.
Please tell me what could be the reason and how I make it functioning as before.

Thank you.
__________________
Jack: Founder, Developer & Owner Of JackAndGenieForever.Com
 
Old May 13th, 2010, 07:24 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,

To start off, and once again, if you're asking questions that are not related to the book directly (which applies to this very question), PLEASE post them in a more generic ASP.NET category here: http://p2p.wrox.com/asp-net-3-5-436/ I've asked this a number of times before, but it seems you haven't picked that up that yet.

That said, if you didn't change the code it must be something else. Try looking at the exception in the catch block, and try sending an e-mail with a normal client such as Outlook using Gmail's server.

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!
 
Old May 13th, 2010, 11:04 AM
Friend of Wrox
 
Join Date: Sep 2009
Posts: 165
Thanks: 5
Thanked 6 Times in 6 Posts
Default

Hello,
I have asked the same question in general forum also but still waiting for reply.
However I debugged the application and found the following exception error msg.

The remote certificate is invalid according to the validation procedure.
I try to find the solution using google but nothing seemed working.
Thanks
__________________
Jack: Founder, Developer & Owner Of JackAndGenieForever.Com
 
Old May 13th, 2010, 11:34 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're not "still waiting for a reply" as Gbianchi posted a reply....

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!
 
Old May 13th, 2010, 05:14 PM
Friend of Wrox
 
Join Date: Sep 2009
Posts: 165
Thanks: 5
Thanked 6 Times in 6 Posts
Default

Hello,
Well a post is related to problem here but that is in C# and on converting that in VB, it is not working also ServicePointManager is reported as not declared.

Is there any server other than gmail which does not require SSL certification and that we can use for sending emails.
I have googled about the error msg. but most of the posts are regarding httphandler.
__________________
Jack: Founder, Developer & Owner Of JackAndGenieForever.Com
 
Old May 13th, 2010, 05:37 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Now it's a crosspost: http://p2p.wrox.com/asp-net-3-5-prof...-new-post.html

Please consider what you post and where. Your problem is now spread over three topics, keeping more people busy than strictly necessary and burning unnecessary CPU cycles and other resources.

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!
 
Old May 19th, 2010, 08:14 AM
Friend of Wrox
 
Join Date: Sep 2009
Posts: 165
Thanks: 5
Thanked 6 Times in 6 Posts
Default

Hello Imar,
Well I tried my yahoo account and set the smtp server accordingly, then it worked fine for the local site, but I am still having problem with the remote site. Using exception object I get only this message
"sending email failed"
May you point out the error. Why it is happening with the remote site in case of yahoo account.
And I also wanna know that How & Why the certificate for google accounts has been invalid after 7 months. Do you also face the same certificate invalid problem with your gmail account while sending mails in website?

And How We can make validate it again so that it works fine as earlier

Thank you
__________________
Jack: Founder, Developer & Owner Of JackAndGenieForever.Com
 
Old May 19th, 2010, 09:09 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Didn't we do this before? As in 7 times or so??

I cannot answer that question for you You need to talk to your host.........There couid be a million reasons....

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!
 
Old May 19th, 2010, 09:40 AM
Friend of Wrox
 
Join Date: Sep 2009
Posts: 165
Thanks: 5
Thanked 6 Times in 6 Posts
Default

May be hosting company is not allowing external SMTP server to be used.
But my question was related to Gmail Account's SSL certification
I have using my Gmail account and hence gmail smtp server for emailing for the last 8 months but it did not give me any error before ever.
It worked with my hosting company as well so no point to consider hosting company any more.
But suddenly it stopped working and reports error as
The remote certificate is invalid according to the validation procedure.
Now the messages are not being sent even from the localhost.
So I want to ask that how certificate has been invalid and how it can get back working

Thanks
__________________
Jack: Founder, Developer & Owner Of JackAndGenieForever.Com
 
Old May 19th, 2010, 10:01 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I feel like a broken record. Ask your host. I feel like a broken record. Ask your host. I feel like a broken record. Ask your host.

Maybe they deleted a root certificate, maybe they are blocking Google, maybe they misconfigured the server. Maybe Google's certificate expired. Who knows. You can keep asking the same question over and over, but you'll be getting the same answer: ask your host. Not sure what you don't understand about that.

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!





Similar Threads
Thread Thread Starter Forum Replies Last Post
email kirangentlebreeze1987 Visual Web Developer 2008 6 December 13th, 2009 01:21 AM
XML Parsing Still Struggling SCADA_Monkey XML 1 March 13th, 2007 03:59 AM
email keyvanjan Classic ASP Basics 2 March 20th, 2006 12:05 AM
Struggling with Configuration RPG SEARCH ASP.NET 1.0 and 1.1 Basics 3 September 29th, 2004 03:06 AM





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