Forum Moderators: open

Message Too Old, No Replies

Send forgotten password help

         

SpyderWeb

1:42 am on May 10, 2004 (gmt 0)

10+ Year Member



Getting error '8004020f' at .Send line, any idea what's going wrong - email not being sent & error message?

With m_objCDO
'Replace with email you wish the message to be sent to
.To = sEmail
'Replace with email you wish the message to be from
.From = "Do@Not.Respond.net"
'Replace with subject
.Subject = "Forgotten Password"
'Replace with information you want to be sent
.HTMLBody = rs("Password")
.Send
End With

duckhunter

4:26 am on May 10, 2004 (gmt 0)

10+ Year Member



Does your SMTP server allows anonymous relaying (non-authenticated)

SpyderWeb

12:45 am on May 12, 2004 (gmt 0)

10+ Year Member



Called my shared host & confirmed:

•SMTP Server is correct
•SMTP Server Port = 25
•SMTP server requires authentication
•User Name = User Name of pop account
•Password = Password of pop account

Gets error message below, I guess figuring out how to debug SMTP server problems is the next step – any suggestions on doing this, I'm lost?

CDO.Message.1 error '80040213'
The transport failed to connect to the server.
/sendit2.asp, line 95

duckhunter

3:05 am on May 12, 2004 (gmt 0)

10+ Year Member



CDO cannot authenticate. You will need to use another mail transport like ASPMail.

SpyderWeb

11:50 pm on May 12, 2004 (gmt 0)

10+ Year Member



Stephen

I have found many similar examples of code on the internet offering solutions to my problem - many provide an authentication portion of code.

Why would many of the solutions I have researched include authentication code with no mention of "... need to use another mail transport like ASPMail."

My problems scenario:

My email account is web based. My MS Outlook is by-passed and remains dormant. I am trying to email the password back to a subscriber upon request via asp. Code looks fine; web host agrees all is fine on their end. I am able to send and receive email between the web host email service and my personal email service. From my error message '80040213', I now know it is a SMTP mail server issue. As to what next step(s) to a solution - I am lost.

Change web host?

Any SMTP mail server issue debug tips appreciated.

Stephen

duckhunter

2:47 am on May 13, 2004 (gmt 0)

10+ Year Member



ASPMail is an Object like CDO

Example:
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Mailer.FromName = "Joe’s Widgets Corp."
Mailer.FromAddress= "Joe@Widgets.com"
Mailer.RemoteHost = "mailhost.localisp.net"
Mailer.AddRecipient "John Smith", "jsmith@toolscorp.com"
Mailer.Subject = "Great SMTP Product!"
Mailer.BodyText = "Dear Stephen" & VbCrLf & "Your widgets order has been processed!"
if Mailer.SendMail then
Response.Write "Mail sent..."
else
Response.Write "Mail send failure. Error was " & Mailer.Response
end if

•SMTP server requires authentication

CDO Cannot Authenticate. How can your Host Provider say the code looks fine AND their SMTP server requires authentication.

If they do not allow CDO, what other Mail Object(s) do they have available for you to use? ASPMail is one of those options if they have the DLL installed.

SpyderWeb

12:06 am on May 14, 2004 (gmt 0)

10+ Year Member



Looks like you are generally correct; I am still getting to the bottom of if Windows 2003 Server offers a way, so much info is dated. I did find one probable exception below. Would this be a viable solution, I have yet to try it?

The link below is the source for the following:
[eggheadcafe.com...]

Many people think that you cannot authenticate a SMTP server using the System.Web.Mail.MailMessage class and opt paying for an alternative.
Well heres a solution that may save you some money.

Dim Msg As New System.Web.Mail.MailMessage
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtpserver"
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "username"
Msg.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "password"
Msg.To = "dst@addr.net"
Msg.From = "src@addr.net"
Msg.Subject = "Subject"
Msg.Body = "Message"
System.Web.Mail.SmtpMail.SmtpServer = "smtpserver"
System.Web.Mail.SmtpMail.Send(Msg)

This example is for a remote server, to authenticate the localhost you do not need to set the smtpserver field or the smtpserverport field.
Just change the sendusing field to 1 & SmtpMail.SmtpServer to localhost

For more things you can do with the MailMessage Class check out MSDN at [msdn.microsoft.com...]

SpyderWeb

6:29 pm on May 15, 2004 (gmt 0)

10+ Year Member



This code works well at sending email from an asp script based on a web host, no authentication required.

Source: Spooky on
[frontpagewebmaster.com...]

<%
Set oMail = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields

'Local service (dont change)
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "http://127.0.0.1"

iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
iConf.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
iConf.Fields.Update
Set oMail.Configuration = iConf
oMail.To = "somebody@msn.com"
oMail.From = "webmaster@xyz.com"
oMail.Subject = "Subject: testing"
oMail.TextBody = "Body: just some message"
oMail.Send
Set iConf = Nothing
Set Flds = Nothing
%>