We have inherited a classic ASP site from a design agency who just wanted us to do a search and replace to change SMTP hosts. No problem, we are a PHP shop but can turn our hands to most things.
On further investigation it was discovered that we need to authenticate with the new SMTP server.
A bit of googling lead us to believe that it is using ASPMail 4 and according to the docs it doesn't do authentication.
http://www.serverobjects.com/comp/Aspmail4.htm
We just googled "SMTPsvg.Mailer" from this call:
Set Mailer = Server.CreateObject("SMTPsvg.Mailer")
Am I correct in my assumptions that the above is ASPMail 4, and the APSMAil doesn't do authentication?
What can I use to authenticate with a SMTP server if I need to replace Aspmail?
As said, use CDO.
set config = CreateObject("CDO.Configuration")
sch = "http://schemas.microsoft.com/cdo/configuration/"
with config.Fields
.item(sch & "sendusing") = 2 ' cdoSendUsingPort
.item(sch & "smtpserver") = application("smtpserver")
.item(sch & "smtpserverport") = application("smtpserverport")
.item(sch & "smtpauthenticate") = 1 'basic auth
.item(sch & "sendusername") = application("sendusername")
.item(sch & "sendpassword") = application("sendpassword")
.update
end with
with CreateObject("CDO.Message")
.configuration = config
.to = ...
.from = ...
.subject = ....
.HTMLBody = ....
call .send()
end with
Docs about each field of the config object can be found here!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With