Connecting Tech Pros Worldwide Forums | Help | Site Map

ASP Help - Sending Email

Newbie
 
Join Date: Sep 2008
Posts: 4
#1: Sep 23 '08
Not new to programming but new to ASP. The uplink provider decided in their infinite wisdom to block port 25 for everyone and require people to use an alternate port with authentication. Unfortunately I don't know enough to be able to see what is happening to know why this isn't working. Is there a debugging mode I can turn on to step through a script to see the malfunction? Can anyone offer a suggestion as to why this portion of the script isn't working??

Any help is GREATLY appreciated.

Ben

P.S. I didn't write this code, just trying to debug it.

Expand|Select|Wrap|Line Numbers
  1. 'CDO send method
  2.     objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
  3.  
  4.     'Out going SMTP server this can be on any machine
  5.     objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.myhost.com"
  6.  
  7.     'SMTP port
  8.     objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 26
  9.  
  10.     'Timeout
  11.     objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
  12.  
  13.     'SMTP server authentication
  14.      objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
  15.      objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "USERNAME@DOMAIN.COM"
  16.      objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PASSWORD"
  17.  
  18.     'Update the CDOSYS Configuration
  19.     objMailConf.Fields.Update
  20.  
  21.     Set objNewMail.Configuration = objMailConf
  22.  
  23.     'Set key properties
  24.     objNewMail.From = "BibleStudent@tftw.org"
  25.     objNewMail.ReplyTo = "BibleStudent@tftw.org"
  26.     objNewMail.To = sendtoemail
  27.  
  28.     If bccemail <> sendtoemail Then
  29.        objNewMail.Cc = bccemail
  30.     End If
  31.  
  32.     objNewMail.Subject= emsubj
  33.     objNewMail.HTMLBody = embody
  34.  
  35.     'Send the email
  36.     objNewMail.Send
  37.  
  38.  
  39.     Set objMailConf = Nothing
  40.     Set objNewMail = Nothing

DrBunchman's Avatar
Moderator
 
Join Date: Jan 2008
Location: Winchester, UK
Posts: 930
#2: Sep 23 '08

re: ASP Help - Sending Email


Hi Ben,

So what's happening when you run this script? Are you getting an error?

Do you know which port your mail server is configured to use?

Dr B
Newbie
 
Join Date: Sep 2008
Posts: 4
#3: Sep 23 '08

re: ASP Help - Sending Email


Dr B,
Mail server is configured to use both ports 25 and 26 to get around this 'blocked port 25 issue'. I did that years ago when traveling because most hotel networks block port 25.

The script appears to execute properly and I get the confirmation of the data sent page afterwords but no email ever arrives. The entire script worked fine before the uplink provider blocked port 25. The authentication lines were simply commented out and the port set to 25 and all was well. Just can't seem to get an email now so I'm sure it has something to do with the authentication but I don't know how to see what it is doing to see what the problem is.

Ben
Newbie
 
Join Date: Sep 2008
Posts: 4
#4: Sep 25 '08

re: ASP Help - Sending Email


I'm still working on this and would appreciate help greatly!

I know the username and password are correct in my code above and can walk through the authentication manually but the script still doesn't send email. It worked when I didn't use authentication through port 25 but since uplink has blocked 25 I've got to now authenticate.

Can anyone recommend a program or other way to see what the script is doing when it talks to the remote mail server so I can see where the error is?

Thanks!
Newbie
 
Join Date: Sep 2008
Posts: 4
#5: Sep 27 '08

re: ASP Help - Sending Email


Anyone?? Can anyone recommend a program or other way to see what the script is doing when it talks to the remote mail server so I can see where the error is?

Thanks!
codegecko's Avatar
Moderator
 
Join Date: May 2007
Location: United Kingdom
Posts: 395
#6: Sep 28 '08

re: ASP Help - Sending Email


Hi Ben,

Try using telnet from your command line to manually connect to the outgoing mail server.
  1. Open a command prompt
  2. Type telnet and hit return
  3. Type "o mail.yourserver.com 25" (without quotes).
    This requests a connection to mail.yourserver.com on port 25 (change if necessary).
    Your mail server will then respond appropriately.
  4. Type "EHLO yourserver.com"
    The server will return a list of supported commands.
  5. Type "USER yourusername"
    The server should acknowledge the receipt of the username
  6. Type "PASS" or "PWD" followed by the user's password.
    The server will then attempt to authenticate you.

Hopefully this should help you diagnose the problem.

medicineworker
Reply


Similar ASP / Active Server Pages bytes