Classic ASP Sending Email with SMTP Authentication

We inherited the classic ASP site from a design agency that simply wanted us to search and replace for changing SMTP hosts. No problem, we are a PHP store, but we can turn our hands into most things.

In a further investigation, it was discovered that we needed to authenticate with the new SMTP server.

A little googling makes us believe that it uses ASPMail 4, and according to the docs, it does not perform authentication.

http://www.serverobjects.com/comp/Aspmail4.htm

We simply sent “SMTPsvg.Mailer” to Google from this call:

Set Mailer = Server.CreateObject("SMTPsvg.Mailer") 

Am I assuming that the above is ASPMail 4 and APSMAil does not perform authentication?

What can I use to authenticate with the SMTP server if I need to replace Aspmail?

+7
smtp asp-classic
source share
4 answers

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 

Documents about each field of the configuration object can be found here !

+18
source share

Yes. Why don't you upgrade to CDO? This article may help.

How to send an email with a CDO?

+2
source share

Check if the hosting provider supports the .NET Framework 2.0 (most of them), if so rename the .asp file to .aspx, delete the code that sends the email, and write a simple code:

http://www.systemwebmail.com/faq/3.8.aspx

Hi

Thomas

+1
source share

As per the docs here, ASPMail 4.x just doesn't support authentication. It looks like you will have to switch to another COM-based SMTP component.

-3
source share

All Articles