ASP Help - Sending Email

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • benbarton
    New Member
    • Sep 2008
    • 4

    ASP Help - Sending Email

    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.

    Code:
    'CDO send method
    	objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
    
    	'Out going SMTP server this can be on any machine
    	objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.myhost.com"
    
    	'SMTP port
    	objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 26
    
    	'Timeout
    	objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
    
    	'SMTP server authentication
    	 objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
    	 objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "USERNAME@DOMAIN.COM"
    	 objMailConf.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "PASSWORD"
    
    	'Update the CDOSYS Configuration
    	objMailConf.Fields.Update
    
    	Set objNewMail.Configuration = objMailConf
    
    	'Set key properties
    	objNewMail.From = "BibleStudent@tftw.org"
    	objNewMail.ReplyTo = "BibleStudent@tftw.org"
    	objNewMail.To = sendtoemail
    
    	If bccemail <> sendtoemail Then
    	   objNewMail.Cc = bccemail
    	End If
    
    	objNewMail.Subject= emsubj
    	objNewMail.HTMLBody = embody
    
    	'Send the email
    	objNewMail.Send
    
    
    	Set objMailConf = Nothing
    	Set objNewMail = Nothing
    Last edited by DrBunchman; Sep 23 '08, 07:14 AM. Reason: Added [Code] Tags - Please use the '#' button
  • DrBunchman
    Recognized Expert Contributor
    • Jan 2008
    • 979

    #2
    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

    Comment

    • benbarton
      New Member
      • Sep 2008
      • 4

      #3
      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

      Comment

      • benbarton
        New Member
        • Sep 2008
        • 4

        #4
        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!

        Comment

        • benbarton
          New Member
          • Sep 2008
          • 4

          #5
          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!

          Comment

          • JamieHowarth0
            Recognized Expert Contributor
            • May 2007
            • 537

            #6
            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

            Comment

            Working...