SMTP, or Simple Mail Transfer Protocol, is a protocol for sending emails over the Internet. This integration allows your workflow to automatically send emails from your email application, such as Gmail or Microsoft 365.
Torq's public SMTP steps include:
Send email with SMTP
If you don't see a step you need, you can create your own in various ways, such as using the Send an HTTP Request step or Torq’s Step Builder, and share it across your organization.
SMTP Server Settings
Use the appropriate server address and port for the email provider that you are creating the integration for.
Email provider | Server address | Port |
smtp.office365.com | 587 | |
smtp-mail.outlook.com | 587 | |
smtp.gmail.com | SSL: 465; TLS: 587 |
Create an SMTP Steps Integration in Torq
Navigate to the Integration: Go to Build > Integrations > Steps > SMTP and click Add Instance.
Fill in the Details:
Give the integration a unique and meaningful name.
In the Server Address field, enter the server address for your email application.
In the Server Port field, enter the port for your email application.
In the Email Address field, enter the email address for the account from which you want to send emails.
In the Password field, enter the password associated with the account email address.
Finalize: Click Add.
If you're using Gmail, the password must be an app password. For more information, consult Google's documentation.
SMTP Message Components
An SMTP message contains a header and a body.
Header
The header contains information about the email, such as:
Sender: sender's email address
Recipient: recipients' email addresses
Subject: email subject
Date (optional): email date
Cc (optional): CC recipients' email addresses
Bcc (optional): BCC recipients' email addresses
Reply-To (optional): email address to which the email reply is directed
Body
The body contains the actual content of the email message. It can be plain text or HTML, depending on the sender's preferences and the recipient's email service capabilities.
Example: BCC Header
This email requests a private discussion with Jane and includes a blind carbon copy (Bcc) sent to a confidential email address.
From: john.doe@example.com
To: jane.smith@example.com
Bcc: confidential@example.com
Subject: Private Discussion
Date: Tue, 01 May 2023 13:00:00 -0400
Hi Jane,
I'd like to discuss a confidential matter with you. Please let me know when you're available for a private conversation.
Kind regards,
John
Example: Reply-To Header
This email is an RSVP confirmation for an event, with a "Reply-To" header directing responses to a specific event's email address.
From: john.doe@example.com
To: jane.smith@example.com
Subject: RSVP Confirmation
Reply-To: events@example.com
Date: Tue, 01 May 2023 12:00:00 -0400
Dear Jane,
I'm happy to confirm my attendance at the upcoming event. Please let the events team know.
Sincerely,
John
Advanced Formatting
For more advanced formatting, such as including attachments, rich text, or non-ASCII characters, the MIME (Multipurpose Internet Mail Extensions) standard is used with SMTP to extend its capabilities. MIME allows for the encoding and decoding of various content types within email messages, enabling more complex formatting and the inclusion of multimedia elements.
Rich-Text (HTML)
From: john.doe@example.com
To: jane.smith@example.com
Subject: Greetings
Date: Tue, 01 May 2023 14:00:00 -0400
MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8
Hello Jane,
Wishing you a great day!
Best regards,
John
Attachment
From: john.doe@example.com
To: jane.smith@example.com
Subject: Project Files
Date: Tue, 01 May 2023 15:00:00 -0400
MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="BOUNDARY"--BOUNDARY Content-Type: text/plain; charset=UTF-8
Hi Jane,
Please find the project files attached.
Best,
John
--BOUNDARY Content-Type: application/pdf; name="project.pdf" Content-Disposition: attachment; filename="project.pdf" Content-Transfer-Encoding: base64BASE64_ENCODED_ATTACHMENT_DATA --BOUNDARY--
Non-ASCII Characters
From: john.doe@example.com
To: jane.smith@example.com
Subject: Foreign Language Example
Date: Tue, 01 May 2023 16:00:00 -0400
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8こんにちは Jane,これは日本語で書かれたメールです。よろしくお願いします, John
Templates
Now that you've added your integrations, check out these specially crafted templates by Torq's security experts. Visit Torq's template library for more.