Search code examples
authenticationasp-classicsmtpjmail

ASP: SMTP authentification fails with JMail


I have a bit specific problem. One of the websites I am taking care of runs on ASP and obtains form, whose results are e-mailed to specific address.

For this to achieve, JMail component is used. As long as e-mail was sent locally (let say to [email protected] through mailserver mail.clientserver.com), there was no problem and no need for authentication. However I recently got request to add another address to copy([email protected]) and that's when problem occurred.

Firstly I tried adding authentication, however same error still occurred, when without:

jmail.Message error '8000ffff'

The message was undeliverable. All servers failed to receive the message

I tried google solutions, temper with some valuables. I am sure user and pass are correct, mail server address also worked when I wasn't try to sent mail with authentication.

Since I prefer PHP, my knowledge and skill with ASP are not of the bests. Have someone experienced something similar and solved it? Or does anyone know some other solution?

The code, which is used for sending mail:

set msg = Server.CreateOBject( "JMail.Message" )
msg.Charset = "windows-1250"
msg.Logging = true
msg.From= "[email protected]"
msg.FromName= name&" - "&mail

'those should care of smtp auth
msg.MailServerUserName = "[email protected]"
msg.MailServerPassword = "smtppass"

'local mail address
msg.AddRecipient "[email protected]"         
'outside mail address
msg.AddRecipient "[email protected]"

msg.Subject = "Some subject"
msg.Body = "Some text"
        
if not msg.Send( "mail.localmailserver.com" ) then
    Response.write "<pre>" & msg.log & "</pre>"
else
    'Succesfully sent, redirect
    Response.Redirect("mailjob_sent.asp")
end if  

Solution

  • So the problem is solved at last. After help with analysis by my colleagues responsible for local mailserver, we found out, the problem was username for SMTP authentification.

    I got confused, since it wasn't [email protected] (I'm referring to example I made), but [email protected].

    So advice for others with similar problem, try to add testing account(one you are using for authentification) to your e-mail client(i.e. Thunderbird) and once that is allright, you have right credentials. Also try sending mail from that account elsewhere.