Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
|
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional 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 April 11th, 2007, 08:22 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default Server sent email requires client logoff - why?

Anyone Help:

I have written a web app that allows a client to request his/her forgotten password to be sent from the server via email. Works fine. However, I find that the email is not sent until the user quits the session (logoffs the app).

Does anyone know how I can force the email to be sent without requiring the user to logoff?

Here's the VB code:

Dim msg as new MailMessage(sAppEmailAdr, sUserEmailAdr)
msg.isBodyHtml = False
msg.Body = "Your password is: " & _sUserPassword
msg.Subject = "Forgotten password"
Dim Smtp as new SmtpClient
Smtp.Send(msg)

Thanks.

VV


 
Old April 11th, 2007, 08:37 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

If they have forgotten their password, isn't it safe to assume that they aren't logged on?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old April 11th, 2007, 08:51 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

This behavior doesn't make any sense. As long as the code completes execution, the mail should be sent. What evidence can you provide that supports this possible behavior?

-Peter
 
Old April 11th, 2007, 09:02 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dparsons and Peter:

1. The user is in the process of logging in. I allow an anonymous attempt to login. Anyone who goes to the website is presented with a login page on which he/she can either provide login info, or press the "Forgot my password" link to a page that request info and then sends the email.

If you provide me with your email address I will add you to the database and provide you with the link and then you can see for yourself how this works. The server folks tell me that the email IS sent.

Send your email address to my email which is: kayuca@cox.net.

VV

 
Old April 11th, 2007, 09:27 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Victor, I experience no problems with this. Using the information and instructions you provided me; after I press the email button and switch back to my Gmail account, the email is already sitting there waiting for me with my password. (E.g. the email arrives almost instanaeously)

??

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========
 
Old April 11th, 2007, 09:39 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 190
Thanks: 0
Thanked 0 Times in 0 Posts
Default

dparsons:

Amazing! I tried it again and it works without having to logoff.

How many times in your profesisonal life does a problem just go away?

The only possible explanation I can think of is that I spent a lot
of time on the telephone with my email provider tracing this thing.
I don't know what all they did in the process. Perhaps there was
a glitch of some kind that was inadvertantly fixed. Whatever...
I can lay this one to rest.

Thanks

VV


Thanks for your help.
VV


 
Old April 11th, 2007, 09:50 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

How many times in your profesisonal life does a problem just go away?

Never. Computers don't fix themselves. What *might* have been happening is that the SMTP server that you are mailing through was spooling the email for some reason and then it eventually was sent. This would give the effect of the mail only being sent after the user logged off as you would have to log off then go check your email, etc.

However, as Peter pointed out, if the code is executed and there are no errors, that email will be sent.

Glad everything is working for you.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========





Similar Threads
Thread Thread Starter Forum Replies Last Post
Email using Goldmine Mail Client echovue Excel VBA 0 January 12th, 2006 11:18 AM
Email Using Client side scriptong qazi_nomi Classic ASP Databases 1 July 1st, 2004 10:52 AM
How to write email client qazi_nomi Classic ASP Basics 2 June 9th, 2004 04:01 AM
ASP Email Client mvollmer Classic ASP Basics 1 March 24th, 2004 04:01 PM
POP3 Web Email Client mvollmer Classic ASP Basics 2 March 9th, 2004 10:16 AM





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