Unable to send transactional email using SMTP Api


#1

Hi,
We have purchased the Transactional-Email addon. I am trying to send a transactional email using the SMTP API.
I used the create SMTP token API given below to create a token.

https://api.hubapi.com/email/public/v1/smtpapi/tokens?hapikey=xxxx-xxxx-xxxx

Then using the userName and Password obtained from the above API, I am using an SMTPClient in my C# code to send the email. However, I get the following error:

Hubspot Mailbox unavailable. The server response was: 5.5.0 Unauthenticated senders not allowed J6r-SG1VW40mQgw8-vYSG0 - hssmtp

Given below is my C# Code snippet:

        var smtp = new SmtpClient("smtp.hubapi.com", 587);
        smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
        smtp.Credentials = new NetworkCredential(smtpUserName, smtpPassword);
        smtp.Send(mail);

Not sure if this could be a security issue in the sense, I am testing this from my local machine. Is there some whitelist of IpAddress or something like that?


#2

@pmanca, Since you are the one who responded to another of my ticket, checking with you regarding this issue.


#3

This issue was specific to my .NET Smtp client. I had to add EnableSsl = true to my client.

This issue can be closed.


#4

Check this one...SMTP mail from C#