I'd like to use my sparkpost account as an email relay, sending email through an autoit script. Below is the script which is pretty standard.
Each time I run it, it fails saying 'Mail failed with error code2, Description: The transport failed to connect to the server.smtp server = smtp.sparkpostmail.com
I've been at this for several hours and can't figure it out. I've worked over email with sparkpost support. They have been pointing me in the direction of it being an issue with TLS
The FAQ link that you referred to says that "You need to connect using TLS (STARTTLS)", not SSL.
Assuming everything else in your script is correct, then try changing the following line:
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
To
$objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendtls") = True
This suggestion is just the easiest and quickest fix to see if it