1
Is anyone using the API with ASP Classic ? Does it work with ASP Classic ? Or does it require ASP.net or something else ?
Question asked by Curtis Kropar www.HawaiianHope.org - 2/27/2024 at 1:19 AM
Unanswered
Subject is pretty much the whole question.
We have several websites, and even a full back office data system built with ASP Classic.  We plan to eventually update, but not right now.

I would like to integrate SmarterMail (build 8797) for the contact forms and communications to use the SmarterMail API to send the emails and take advantage of smartermail signing the emails.

So, Does anyone currently use ASP Classic with the smartermail API ?  will it work and can someone give me a sample code ?
Or, do I need to use ASP.net for it to work, and is there a sample cod for it ? a basic "send mail"
Or, does the API need to be used by another language ?

www.HawaiianHope.org - Providing technology services to non profit organizations, low income families, homeless shelters, clean and sober houses and prisoner reentry programs. Since 2015, We have refurbished over 11,000 Computers !

14 Replies

Reply to Thread
0
J. LaDow Replied
Most of our customer client sites are ClassicASP running on a separate web server and they use CDOSYS (IIS-SMTP) to open a connection to our SmarterMail server as any old "SMTP Client" -- authentication is possible, and TLS can be used as well in this setup if your mail server responds with a valid certificate.

I have a ton of ClassicASP code that accomplishes this but it's part of a mini-framework used for client websites and would take a little "cleanup" to send you samples.

If you setup basically a blank .ASP page, and add Server.CreateObject("CDO.Message") and run it -- if it doesn't throw an exception, you have all you need (other than some code) to have SMTP via ClassicASP.

CDO uses a Message and Configuration object to function properly - both are needed.
MailEnable survivor / convert --
1
YS Tech Replied
You don't need to use the API to send from a classic asp form, all you are sending to is an email account after all. Use either CDO as J. Ladlow has suggested or a server component like Persits ASPEmail.

If you wish to use the API to populate and unpopulate a mailing list then you can do this with ClassicASP, I have a few sites that do this still. Then you can use your form to send to that mailing list.
1
We have been using the CDOSYS for 15+ years to send messages. The problem is they are getting kicked from gmail and others because gmail is looking for domain verification. If we are just sending to our own server they all work fine. But when sending to gmail and some others they get bounced.

Also, AS I understand it, If we use the API then the sent emails will end up in the sent items folder, yes ?  This way we can more easily track what was sent and by who
www.HawaiianHope.org - Providing technology services to non profit organizations, low income families, homeless shelters, clean and sober houses and prisoner reentry programs. Since 2015, We have refurbished over 11,000 Computers !
0
J. LaDow Replied
I must've misunderstood -- 

On our configuration, we use CDOSYS via network, connect from our web server to our mail server via SMTP and initiate a send. Our SM server packages up the email and spools it as if it was sent from webmail or a client - and that keeps us from having any signing issues because our signing is done by the SM server.

It sounds to me like your current configuration has your websites contacting outside mailservers directly - whereas the method we use routes EVERYTHING from our web servers through our SM install. We do this primarily because of the signing and security limitations of the IIS SMTP module (which CDOSYS uses depending on your configuration).

Sorry if I overstepped and never meant to insult previous knowledge.


MailEnable survivor / convert --
0
No insult perceived. Open Exchange of knowledge is how we solve problems.
Well, apparently there is more than one way to use CDO and I might be doing it "wrong" - 

What you described is what I want to do. (do sent emails end up in your sent folder ?) 
What we have now is not doing that. 
Our mail server and web server are the same machine (for now) until we grow this a bit more.

This is essentially what we are doing : Is there a better way ? I have not changed this code in like 12 years.

          Dim ObjSendMail
          Set ObjSendMail       = server.CreateObject("CDO.Message") 
          strError              = ""
          strSendFromMailServer = "mail.AwesomeDomain.com"
          strSendFromEmail      = "CoolMail@AwesomeDomain.com"
          strSendFromPassword   = "FBI_kine_Encrypted_password"
               
          'This section provides the configuration information for the remote SMTP server.
               
          ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing";)              = 2
          ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver";)             = strSendFromMailServer
          ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport";)         = 25 
          ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl";)             = False
          ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout";)  = 60
          ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate";)       = 1 'basic (clear-text) authentication
          ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername";)           = strSendFromEmail
          ObjSendMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword";)           = strSendFromPassword
               
          ObjSendMail.Configuration.Fields.Update
              
          ObjSendMail.To        = strEmailAddress
          ObjSendMail.Subject   = strSubject
          ObjSendMail.From      = strSendFromEmail
          ObjSendMail.Bcc       = strSendFromEmail

          ObjSendMail.TextBody  = strMessage

          On Error Resume Next
               
          ObjSendMail.Send
www.HawaiianHope.org - Providing technology services to non profit organizations, low income families, homeless shelters, clean and sober houses and prisoner reentry programs. Since 2015, We have refurbished over 11,000 Computers !
0
Gene Kendrick Replied
I still do it in 2024. lol... but the ice is getting thinner. I used to send via inetpub/mailroot/ folders in conjunction with a Gmail account. They shut that down. Now, I send using smtp.sendgrid.net. I had to set some DNS records on the domain side (mydomain.com) to get it to work.

I received an email from SendGrid 3 days ago saying Gmail will be enforcing new requirements in 4/2024. If I understood it right SendGrid basically said it will affect those that don't have the required DNS records set up, but I could be wrong or missed something in my interpretation. So, we will see. 

If it is the final blow for me, I think a rewrite in something else is my only option. In what I don't know.

0
YS Tech Replied
I still have classic asp sites running for clients (they don't want to change as the sites work for them!). I am gradually porting the sites over to php/javascript. It's the closest language I could learn quickly ;o)
0
Hey All !
So, I have still not gotten the ASP API thing going. But I really need to get this done here in the next few weeks.   Sorry, but I need a sample to see it. Apparently I am doing something wrong and just really not sure what that is.
So, Can someone provide me a full example of making the connection and sending a basic email with ASP ?

www.HawaiianHope.org - Providing technology services to non profit organizations, low income families, homeless shelters, clean and sober houses and prisoner reentry programs. Since 2015, We have refurbished over 11,000 Computers !
0
YS Tech Replied
It depends what you are trying to do.
I went the route of creating a mailing list in SM and then using the API to populate/remove from this, then send as you would normally with ASP to the mailing list; that in turn will send out in an orderly manner to the people on the list.
0
Gene Kendrick Replied
I ended up finding a gmail Host replacement. So, it's still working as of now. This the code I use. It wouldn't let me post the code with a hyperlink. Nevertheless, the microsoft schema hypelink in your code is the same code I use.  So, you just need to add the link to each .Item.    

I hope it helps. 
-----------------------------------------------------------------------------------
Set cdomsg = CreateObject("CDO.message")

With cdomsg.Configuration.Fields
        .Item("sendusing") = 2
        .Item("smtpserver") = HostServerName 
        .Item("smptserverport") = 587
        .Item("smtpauthenticate") = 1
        .Item("smtpusessl") = True
        .Item("smtpconnectiontimeout") = 60
        .Item("sendusername") = HostUserName
        .Item("sendpassword") = HostPassword
        .Update
End With

With cdomsg
       .To = Receiver
       .From = Sender
       .Subject = Subject
       .HTMLBody = Message

       On Error Resume Next
    
      .Send
            
End With
0
So Gene, Your authenticates through smartermail, Signs and the sent emails end up in the sent items folder ?
The only thing I can see that is different is that you have SSL. 
        .Item("smptserverport") = 587
        .Item("smtpusessl") = True

When I first wrote ours years ago we could not get the SSL to work because the windows server version was so old. But now our SSL works. Is that really the only difference ?


www.HawaiianHope.org - Providing technology services to non profit organizations, low income families, homeless shelters, clean and sober houses and prisoner reentry programs. Since 2015, We have refurbished over 11,000 Computers !
0
Gene Kendrick Replied
I don't use smartermail. I was using gmail when I made the first post because you made mention of your emails getting bounced. I was just posting basically saying mines are getting bounced too. At that time, I was looking for solutions to replace gmail. I now use turboSmtp mail server instead of gmail. It's not great, but it works.

Those are the only 2 differences. 
0
Jack. Replied
Sorry for not responding earlier. Yes, I have some integrations of Classic ASP + SmarterMail using API, for example, blocking attacking IPs from ASP."
0
I am finally working on this (the actual API) , and for the most part its working (rather - not crashing) I am making some progress and excited, but I have hit a snag and not sure what the issue is. (BTW... This is on Build 9014 that has been upgraded 3 times from the oldest version of 14 Pro years ago... so not sure if there is a problem or a holdover bug from ages ago)

I can authenticate and I get a "200" and the "responseText"....  But both the "accessToken" and "refreshToken" parameters are blank (or null ?)  Nothing ever shows up there.  I see a lot of other data, including "autoLoginToken" But this is what I get (replaced key data with junk)
So when I go to send the email, I get a 401 every time.

responseText -- {"emailAddress":"blahhhblahh@moreblah.com","changePasswordNeeded":false,"passwordExpired":false,"displayWelcomeWizard":false,"isAdmin":false,"isDomainAdmin":false,"isLicensed":true,"autoLoginToken":"CrazyBigLongString","autoLoginUrl":"https://mail.hawaiianhope.org/interface/autologin?autologin=CrazyBigLongString","localeId":"en","requirements":null,"isImpersonating":false,"canViewPasswords":false,"accessToken":"","refreshToken":"","accessTokenExpiration":null,"refreshTokenExpiration":null,"username":"blahhhblahh@moreblah.com","success":true,"resultCode":200}
www.HawaiianHope.org - Providing technology services to non profit organizations, low income families, homeless shelters, clean and sober houses and prisoner reentry programs. Since 2015, We have refurbished over 11,000 Computers !

Reply to Thread