Link to home
Start Free TrialLog in
Avatar of mdlp
mdlpFlag for United States of America

asked on

vbs script to send email through an existing smtp server, the server error response was: 530 authentication required

when trying to send an email via vbs script, I am gerring an erro
    server response was: 530 authentication required
THE CODE IS AS FOLLOWS;
Set objEmail = CreateObject("CDO.Message")

objEmail.From = "allbeit@earthlink.net"
objEmail.To = "allbeit2@earthlink.net"
objEmail.Subject = "TEST EMAIL subject"
objEmail.Textbody = "TEST EMAIL text."
objEmail.AddAttachment "C:\TEST.txt"

objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusername") = "vfm-sdlkjfsdd@la.twcbc.com"

objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "A34523344"

objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2

objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.biz.rr.com"

objEmail.Configuration.Fields.Item _
    ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25

objEmail.Configuration.Fields.Update

objEmail.Send

Avatar of Felix Grushevsky
Felix Grushevsky
Flag of United States of America image

Your mail server requires authentication to accept smtp mail

add this line before objEmail.Configuration.Fields.Update

objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 'basic (clear-text) authentication

assuming that your server supports clear-text authentication
Avatar of mdlp

ASKER

thank you fgrushevsky,
I added the line as you suggested, but this created a different error:
the message could not be sent to the SMTP server.  The transport error code was 0x80040217. The server response was not available

code: 80040211
source: (null)
I commented the added line and it went back to the original error message.  Does this mean that it will not allow clear text authentication?

I checked my existing outlook on the computer and it does not require SPA in the password settings.

I hope this helps
Thank you
mdlp

ASKER CERTIFIED SOLUTION
Avatar of Felix Grushevsky
Felix Grushevsky
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mdlp

ASKER

I am so sorry for the delay, got pulled away to another program, I am still researching the issue, but it seem that one of MS security "fixes" is tripping this up.  You have gone way beyond what the point reward for so thank you and I am thinking of trying a different route.