# SMTP API Not delivering Email

**URL:** <https://community.hubspot.com/t/smtp-api-not-delivering-email/12849>\
**Category:** APIs & Integrations\
**Tags:** email\
**Created:** [February 7, 2019, 4:31pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849 "2019-02-07T16:31:25Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bvstone](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bvstone/32/58551_2.png) [@bvstone](https://community.hubspot.com/u/bvstone)\
**Post date:** [February 7, 2019, 4:31pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/1 "2019-02-07T16:31:25Z")

</div>

I am working with a customer to interace with HubSpot on an IBM i (AS400) system.

I created an email token, got the user and password, and tried to send an email using that information.

All logs connecting to the HubSpot SMTP relay say the email was accepted and queued for delivery, but I didn’t receive it (yes, I checked spam as well).

I also don’t see a history of the email in the dashboard for the account.

Here’s a log of the communications:

```auto
Attempting to connect to server smtp.hubapi.com on port 587....
Waiting for connection...
Connection to server smtp.hubapi.com on port 587 succeeded!
<smtp.hubapi.com says:> 220 smtp.hubapi.com ESMTP R6H7kfThjW17s7df6K-Bj-0 - hssmtp
Sending EHLO command to smtp.hubapi.com.
<MAILTOOL says:> EHLO xxxxx
<smtp.hubapi.com says:> 250-smtp.hubapi.com at your service, [/172.16.31.222:25234]
Sending STARTTLS command.
<MAILTOOL says:> STARTTLS
<smtp.hubapi.com says:> 220 2.0.0 Ready to start TLS R6H7kfThjW17s7df6K-Bj-0 - hssmtp
SSL handshake succeeded!
Sending EHLO command to smtp.hubapi.com.
<MAILTOOL says:> EHLO xxxxxxx
<smtp.hubapi.com says:> 250-smtp.hubapi.com at your service, [/172.16.31.222:25234]
Sending AUTH LOGIN command.
<MAILTOOL says:> AUTH LOGIN
Sending User ID.
<smtp.hubapi.com says:> 334 VXNlcm5hbWU6 R6H7kfThjW17s7df6K-Bj-0 - hssmtp
<MAILTOOL says:> [user removed]
<smtp.hubapi.com says:> 334 UGFzc3dvcmQ6 R6H7kfThjW17s7df6K-Bj-0 - hssmtp
Sending Password.
<MAILTOOL says:> [password removed]
<smtp.hubapi.com says:> 235 2.0.0 Authentication successful. R6H7kfThjW17s7df6K-Bj-0 - hssmtp
<MAILTOOL says:> MAIL FROM: <email address removed>
<smtp.hubapi.com says:> 250 2.0.0 Sender address accepted. R6H7kfThjW17s7df6K-Bj-0 - hssmtp
<MAILTOOL says:> RCPT TO: <receipient removed>
<smtp.hubapi.com says:> 250 2.0.0 250 Recipient address accepted. R6H7kfThjW17s7df6K-Bj-0 - hssmtp
Sending <DATA> to start message.
<MAILTOOL says:> DATA
<smtp.hubapi.com says:> 354 Continue R6H7kfThjW17s7df6K-Bj-0 - hssmtp
<--MIME DATA [210 bytes]-->
Sending <.CRLF> to end message.
<MAILTOOL says:> .
<smtp.hubapi.com says:> 250 2.0.0 Ok queued as 1549549116344/e719b4af-6e4b-4cd3-94d3-a1491efa0c36 R6H7kfThjW17s7df6K-Bj-0 - hssmtp
Sending QUIT command to smtp.hubapi.com.
<MAILTOOL says:> QUIT
<smtp.hubapi.com says:> 221 2.0.0 cheers R6H7kfThjW17s7df6K-Bj-0 - hssmtp

```

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [February 8, 2019, 2:34pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/2 "2019-02-08T14:34:00Z")

</div>

Hi, @bvstone.

Happy to help investigate. Could you share a link to the contact record to which you attempted to send the email? (I just need to know the client’s Hub ID and email address, so this is one way you can send it to me without posting on this public forum.)

---

<div class="post-metadata">

**Author:** ![bvstone](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bvstone/32/58551_2.png) [@bvstone](https://community.hubspot.com/u/bvstone)\
**Post date:** [February 8, 2019, 2:38pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/3 "2019-02-08T14:38:33Z")

</div>

@IsaacTakushi,

It was an email address that was used. I don’t believe it’s set up as a contact in my customer’s account. I didn’t want to post the email here for spambots to collect. 🙂

[redacted]

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [February 8, 2019, 2:41pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/4 "2019-02-08T14:41:03Z")

</div>

Totally fair, @bvstone. Thanks for sharing. I’ve redacted the email so there’s even less risk of that  
 ![16x16_smiley-wink.png.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/5/550f65d2f3384e5c8911d89f2498aa3ac2203a21.png)

Could you still specify your client’s Hub ID, though?

---

<div class="post-metadata">

**Author:** ![bvstone](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bvstone/32/58551_2.png) [@bvstone](https://community.hubspot.com/u/bvstone)\
**Post date:** [February 8, 2019, 3:24pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/5 "2019-02-08T15:24:43Z")

</div>

@IsaacTakushi

2618299

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [February 11, 2019, 10:42pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/6 "2019-02-11T22:42:57Z")

</div>

Hey, @bvstone.

Apologies for the delayed response.

My internal tool is showing 4 successful transactional email deliveries from account **2618299** to the email you specified on Thursday, **7 February 2019**.

Indeed, all four messages were opened at one point, so they were delivered to someone.

---

<div class="post-metadata">

**Author:** ![bvstone](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bvstone/32/58551_2.png) [@bvstone](https://community.hubspot.com/u/bvstone)\
**Post date:** [February 11, 2019, 11:00pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/7 "2019-02-11T23:00:48Z")

</div>

@IsaacTakushi, those emails you mentioned were sent using the Single Send Email api, not the SMTP API. The Single Send API I have working just fine.

With the SMTP API (which this post is about) you send email by directing your email client to use the server and credentials specified by HubSpot after setting up credentials/SMTP tokens for a user.

As you can see in the original post, that is the connection that was made, the user and password that was set up was used, and the mail server accepted the email for delivery.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [February 11, 2019, 11:07pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/8 "2019-02-11T23:07:00Z")

</div>

Sorry about that, @bvstone. I forgot we were discussing the SMTP API. I’ll dig into this further.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [February 13, 2019, 7:46pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/9 "2019-02-13T19:46:06Z")

</div>

Thanks for your continued patience, @bvstone.

I haven’t been able to uncover the issue yet, but I wanted to confirm whether you’ve tried resetting [your SMTP token](https://app.hubspot.com/settings/2618299/marketing/email/smtp) yet? Could you go ahead and do that and let me know if you receive the same response but no tracking?

If you’re still experiencing the issue after this step, I’ll loop in one of our email deliverability consults for further investigation.

---

<div class="post-metadata">

**Author:** ![bvstone](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bvstone/32/58551_2.png) [@bvstone](https://community.hubspot.com/u/bvstone)\
**Post date:** [February 13, 2019, 8:41pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/10 "2019-02-13T20:41:05Z")

</div>

@IsaacTakushi

I did just try resetting the token/password. I tried again. The SMTP server reported:

02/13/2019 14:25:57 - 250 2.0.0 Ok queued as 1550090317383/ba5ae739-d697-483c-925f-bcf80df98e1e R6H8vWS5JW5gnfLG7GHX6L0 - hssmtp

Just as before, it says the email is queued for delivery, but it’s never sent.

Does the email need to come from a specific allowlisted IP address, or something else?

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [February 14, 2019, 10:20pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/11 "2019-02-14T22:20:20Z")

</div>

Thanks for confirming, @bvstone.

I don’t believe it needs to come from a allowlisted IP address if you have the correct token and password.

I’ll investigate further with my team. Am I correct in believing you tested again with the same contact as earlier?

---

<div class="post-metadata">

**Author:** ![bvstone](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bvstone/32/58551_2.png) [@bvstone](https://community.hubspot.com/u/bvstone)\
**Post date:** [February 15, 2019, 1:23am UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/12 "2019-02-15T01:23:52Z")

</div>

@IsaacTakushi yes… the email was sent to bvstone at bvstools dot com.

The last message I sent had an email ID that you should be able to find in your SMTP server’s logs. If not and you need to turn on some debugging, let me know and I can send another test.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [February 19, 2019, 5:38pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/13 "2019-02-19T17:38:16Z")

</div>

Hey, @bvstone.

I’ve shared the details of your issue with the email team. We’ll be digging in further on our end.

That said, I’ve realized you said you _reset the password_ of the SMTP token you created on 2/7/19 but didn’t _deactivate_ that token and create a new one. The latter is what I meant to ask on 2/13/9, but I realize the question could have been much clearer.

Could you generate a new SMTP token on [this page](https://app.hubspot.com/settings/2618299/marketing/email/smtp), delete token 69689745, and then try sending another email to yourself with the newly generated token?

---

<div class="post-metadata">

**Author:** ![bvstone](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/bvstone/32/58551_2.png) [@bvstone](https://community.hubspot.com/u/bvstone)\
**Post date:** [February 19, 2019, 5:45pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/14 "2019-02-19T17:45:12Z")

</div>

@IsaacTakushi

Done… result:

250 2.0.0 Ok queued as 1550598216905/918872bb-d487-4f32-972f-2c2ede960e33 J6Jfxt9-W6W0F2W2DBrSj0 - hssmtp

No email received.

---

<div class="post-metadata">

**Author:** ![cjbaker](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cjbaker/32/92090_2.png) [@cjbaker](https://community.hubspot.com/u/cjbaker)\
**Post date:** [February 13, 2019, 9:50pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/15 "2019-02-13T21:50:46Z")

</div>

Hello, I’m having the same problem with the SMTP API. I’m using Python’s smtplib, which works fine when I use another server and account, like gmail for example. My company has the transactional email add-on.

Like bvstone, I’m connecting to [smtp.hubapi.com](http://smtp.hubapi.com) , although I’m using STARTTLS on port 587 (as documented here [https://developers.hubspot.com/docs/methods/email/transactional\_email/smtpapi\_overview/list/create](https://developers.hubspot.com/docs/methods/email/transactional_email/smtpapi_overview/list/create)). I’m able to connect to the SMTP server, login, and send the message with no errors, but the email is not received, and it does not show up in Hubspot under the contact’s email history. I’ve tried manually sending a transactional email with the same sender and recipient through the Hubspot web interface, and it works correctly. I’ve tried resetting the token’s password. Why can’t I send a message through SMTP?

---

<div class="post-metadata">

**Author:** ![cjbaker](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cjbaker/32/92090_2.png) [@cjbaker](https://community.hubspot.com/u/cjbaker)\
**Post date:** [February 14, 2019, 1:59pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/16 "2019-02-14T13:59:07Z")

</div>

I just wanted to add that I tried running the Python code on the Hubspot documentation page linked to in my previous post, just changing TO\_EMAIL to my address, and I did not receive the message. I checked my spam box. The script reports success, with “Enqueued email send…”. Note that this script uses the demo portal. The functionality appears to be broken.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [February 14, 2019, 10:21pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/17 "2019-02-14T22:21:38Z")

</div>

Thanks for all this information, @cjbaker.

The one part I need to investigate further is the contact’s email address. If you send me a link to the contact in your account, that’ll be enough.

---

<div class="post-metadata">

**Author:** ![cjbaker](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/cjbaker/32/92090_2.png) [@cjbaker](https://community.hubspot.com/u/cjbaker)\
**Post date:** [February 14, 2019, 10:27pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/18 "2019-02-14T22:27:04Z")

</div>

Hi @IsaacTakushi I don’t seem to be able to send you a private message, so I’m posting the link: [HubSpot](https://app.hubspot.com/contacts/4871527/contact/15351/?interaction=note)

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [February 19, 2019, 5:41pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/19 "2019-02-19T17:41:20Z")

</div>

Thanks for this information, @cjbaker.

My colleague Andreas has let me know he is working with you in a support ticket. I’ll be assisting him on my end to get to the bottom of your issue!

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [March 4, 2019, 9:23pm UTC](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849/20 "2019-03-04T21:23:01Z")

</div>

Hi, @cjbaker.

Sincere apologies for the delayed response. I appreciate your patience while our team investigated your reports.

We checked our logs for the messages we discussed above. In both cases, we recorded a “ **Missing at least one required body: ‘html’ or ‘text’** ” message, which indicates the message either lacked content or wasn’t formatted properly.

Could you confirm that you included content for the email’s body and provide an example of a message you passed to the SMTP API?

[Next page](https://community.hubspot.com/t/smtp-api-not-delivering-email/12849.md?page=2)
