APIs & Integrations

jmichaelTest
Member

Unable to send transactional email using SMTP Api

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?

0 Upvotes
3 Replies 3
Not applicable

Unable to send transactional email using SMTP Api

Check this one...SMTP mail from C#

0 Upvotes
jmichaelTest
Member

Unable to send transactional email using SMTP Api

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

0 Upvotes
jmichaelTest
Member

Unable to send transactional email using SMTP Api

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

This issue can be closed.

0 Upvotes