Unable to send transactional email using SMTP Api


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.


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);

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?


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


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

This issue can be closed.


Check this one...SMTP mail from C#