SMTP Integration with Netcore
Learn how to send an SMTP Email via the Netcore CPaaS dashboard.
Overview
- Simple Mail Transfer Protocol (SMTP) is the standard protocol for sending email messages between servers.
- SMTP handles the submission of outgoing email from applications or mail clients to another mail server or relay.
Netcore supports SMTP so you can send transactional or marketing emails via an SMTP interface, using credentials already provided in your Netcore account. This can be an easier alternative (or complement) to API-based sending, especially in legacy systems or standard mail clients.
Example Use Case – Sending Order Confirmation Emails
Scenario:
An online store wants to send order confirmation emails every time a customer completes a purchase.
Solution with Netcore SMTP:
-
The store’s backend server is configured with Netcore SMTP (
smtp.netcorecloud.net, port 587). -
When a customer places an order, the server creates an email message with:
- From:
[email protected] - To: customer’s email
- Subject: “Your Order Confirmation”
- Body: Order details and shipping info.
- From:
-
The server authenticates with Netcore SMTP using its username and password.
-
Netcore delivers the email to the customer’s inbox, and the store can view delivery reports in the Netcore dashboard.
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
# SMTP configuration
SMTP_HOST = "smtp.netcorecloud.net"
SMTP_PORT = 587
SMTP_USERNAME = "YOUR_SMTP_USERNAME"
SMTP_PASSWORD = "YOUR_SMTP_PASSWORD"
# Email details
sender_email = "[email protected]"
recipient_email = "[email protected]"
# Create the email
msg = MIMEMultipart()
msg["From"] = sender_email
msg["To"] = recipient_email
msg["Subject"] = "Your Order Confirmation"
body = """
Hello,
Thank you for your order! Your payment has been received and we are preparing your shipment.
Order Details:
- Order ID: 12345
- Estimated Delivery: 3-5 business days
Best regards,
Your Store Team
"""
msg.attach(MIMEText(body, "plain"))
# Send the email
try:
with smtplib.SMTP(SMTP_HOST, SMTP_PORT) as server:
server.starttls() # Secure the connection
server.login(SMTP_USERNAME, SMTP_PASSWORD)
server.sendmail(sender_email, recipient_email, msg.as_string())
print("Order confirmation email sent successfully!")
except Exception as e:
print("Failed to send email:", e)
const nodemailer = require("nodemailer");
// SMTP configuration
const transporter = nodemailer.createTransport({
host: "smtp.netcorecloud.net",
port: 587,
secure: false, // use TLS
auth: {
user: "YOUR_SMTP_USERNAME",
pass: "YOUR_SMTP_PASSWORD",
},
});
// Email details
const mailOptions = {
from: "[email protected]",
to: "[email protected]",
subject: "Your Order Confirmation",
text: `Hello,
Thank you for your order! Your payment has been received and we are preparing your shipment.
Order Details:
- Order ID: 12345
- Estimated Delivery: 3-5 business days
Best regards,
Your Store Team
`,
};
// Send the email
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.error("Failed to send email:", error);
}
console.log("Order confirmation email sent:", info.messageId);
});
Integrate with SMTP
This section lists the required configuration and best practices.
| Component | Value / Description |
|---|---|
| SMTP Hostname | smtp.netcorecloud.net |
| Ports | 25, 2525, 587 (for TLS/STARTTLS) |
| Username & Password | Use the SMTP username and password from your Netcore → Settings → Integrations section. |
| SSL / TLS Use | Use STARTTLS / TLS on supported ports (e.g., 587, 2525). If using port 465, standard SSL may be required (if supported. |
Step-by-step Setup
- Log in to your Netcore dashboard.
- Navigate to Settings → Integrations to get your SMTP credentials (username/password).
- In your system (application server, mail library, or client), set the SMTP host to
smtp.netcorecloud.net. - Use one of the supported ports. If connecting over TLS / STARTTLS, use port 587 or 2525. If needed, use port 25 (less secure).
- Enable authentication: set username and password.
- Ensure your system negotiates TLS if available.
Refer to the given table to know the fields available on the SMTP Relay screen.
| Field | Description |
|---|---|
| Host | The SMTP server address used to send emails. |
| Port | The network port used to connect to the SMTP server. Default is 25; you can also use 587 or 2525 for TLS/STARTTLS connections. |
| Authentication | Defines the authentication method. Netcore supports Plain text or TLS; TLS is recommended for secure connections. |
| Username | Your unique SMTP username, auto-generated by Netcore, required to authenticate your connection. |
| Password | The SMTP password linked to your account. Click Show to view it or Change to regenerate a new one. Remember to update all apps using this password if you change it. |
| Allowed IPs | Optional security feature to restrict SMTP access to specific IP addresses or ranges (e.g., 203.0.113.25, 10.0.0.0/24). Leave blank to allow all IPs. |
Tips
- Always verify that your sending domain is properly verified and approved in Netcore (see “sending domains”) so that sender emails are not rejected.
- Your firewall / hosting provider must allow outbound SMTP on the port you choose (especially if using 587 or 2525).
Send Test Mail
Click SEND TEST MAIL to test our SMTP connection and activity logging. Sends a sample email and logs activity so you can confirm that your configuration works.
Select Email From and Email To, click SEND MAIL to complete the process.
Character Encoding
- Use UTF-8 encoding for message subject, body, and headers. It supports international characters, emojis, etc.
- For plain text emails, specify the charset header:
Content-Type: text/plain; charset="UTF-8" - For HTML emails:
Content-Type: text/html; charset="UTF-8" - Ensure your programming library or mail client is configured to encode the message accordingly (avoid default system encodings that may be ANSI / ASCII only).
IP Binding Feature over SMTP
Netcore offers IP binding (or dedicated IP pools) so that outbound SMTP emails are sent via specific IP addresses, improving deliverability and reputation.
- What it does: Binds your SMTP traffic to a dedicated (or shared but narrower) IP address.
- Use cases: High-volume senders, wish to isolate reputation, or needing consistent deliverability.
- How to enable: Typically from your Netcore dashboard → Account / Sending settings → request / configure dedicated IP / IP binding.
- What to watch out for: IP warm-up, consistent sending patterns, proper reverse DNS, SPF / DKIM / DMARC alignment.
Send an SMTP Email
Here are examples of sending emails via SMTP using popular languages and using well-known mail clients.
Examples in Programming Languages
Python (using smtplib)
smtplib)import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
smtp_host = "smtp.netcorecloud.net"
smtp_port = 587
username = "YOUR_SMTP_USERNAME"
password = "YOUR_SMTP_PASSWORD"
msg = MIMEMultipart()
msg["From"] = "[email protected]"
msg["To"] = "[email protected]"
msg["Subject"] = "Test Email via Netcore SMTP"
body = """\
Hello,
This is a test email sent using Netcore SMTP.
Regards,
Your app
"""
msg.attach(MIMEText(body, "plain"))
with smtplib.SMTP(smtp_host, smtp_port) as server:
server.starttls()
server.login(username, password)
server.sendmail(msg["From"], msg["To"], msg.as_string())
Node.js (using nodemailer)
nodemailer)const nodemailer = require("nodemailer");
let transporter = nodemailer.createTransport({
host: "smtp.netcorecloud.net",
port: 587,
secure: false, // true for port 465, false for others
auth: {
user: "YOUR_SMTP_USERNAME",
pass: "YOUR_SMTP_PASSWORD",
},
});
let mailOptions = {
from: '"Sender Name" <[email protected]>',
to: "[email protected]",
subject: "Test Email via Netcore SMTP",
text: "Hello,\nThis is a test email via Netcore SMTP.",
};
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.error("Error sending mail:", error);
}
console.log("Message sent:", info.messageId);
});
PHP (using PHPMailer)
PHPMailer)use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'vendor/autoload.php';
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
$mail->Host = 'smtp.netcorecloud.net';
$mail->SMTPAuth = true;
$mail->Username = 'YOUR_SMTP_USERNAME';
$mail->Password = 'YOUR_SMTP_PASSWORD';
$mail->SMTPSecure = 'tls'; // or 'ssl' if using port 465
$mail->Port = 587;
$mail->setFrom('[email protected]', 'Sender Name');
$mail->addAddress('[email protected]', 'Recipient Name');
$mail->Subject = 'Test Email via Netcore SMTP';
$mail->Body = "Hello,\nThis is a test email via Netcore SMTP.";
$mail->send();
echo 'Message has been sent';
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
Using Common Mail Clients
| Client | Setup Steps |
|---|---|
| Outlook | 1. Open Account Settings. 2. Add a new email account or modify existing. 3. For SMTP server, set host = smtp.netcorecloud.net, port = 587, encryption TLS. 4. Enter your SMTP username and password. 5. Make sure "Require logon using secure password" / authentication is enabled. |
| Thunderbird | 1. Tools → Account Settings. 2. Outgoing Server (SMTP) settings. 3. Configure with host, port, SSL/TLS or STARTTLS, username/password. 4. Save and test sending. |
Customizing Messages with SMTP Headers
Headers allow you to add metadata or control behavior of email delivery. Some you may use:
| Header | Purpose / Example |
|---|---|
From: | The displayed sender — e.g. From: Your App <[email protected]> |
Reply-To: | Where replies should be sent, if different from From: |
CC: / BCC: | Carbon copy / blind carbon copy recipients |
Message-ID: | Unique ID of the message — many mail libraries set this automatically |
Date: | Timestamp of sending — usually auto-generated, but can be customized |
MIME-Version: & Content-Type: | For specifying multipart emails / HTML vs plain text / charset |
DKIM-Signature: / SPF related headers | For ensuring compliance and deliverability (Netcore handles DKIM/SPF setup for verified domains) |
Custom headers (e.g. X-Tag:, X-Campaign:, etc.) | You may use for your internal tracking / integrating with Netcore’s tagging / dashboards |
Best Practices
- Don’t forget “From” addresses outside verified domains.
- Avoid conflicting headers.
- Use anti-spam compliant headers (e.g.,
List-Unsubscribeif needed).
Send Test SMTP Email Using Telnet
Telnet provides a low-level way to test whether your SMTP server is reachable and configured correctly.
$ telnet smtp.netcorecloud.net 587
Once connected:
EHLO yourhostname.com
STARTTLS
[negotiation of TLS here]
EHLO yourhostname.com
AUTH LOGIN
[base64-encoded username]
[base64-encoded password]
MAIL FROM:<[email protected]>
RCPT TO:<[email protected]>
DATA
Subject: Test SMTP via Netcore
Hello,
This is a test message via Netcore using SMTP and telnet.
.
QUIT
What you expect to see:
220on initial connection- After EHLO, capabilities including
STARTTLS - After AUTH, success (235) or failure codes
- After
DATAand ending with., message accepted (e.g.250 Ok)
Using Tags with SMTP
Tags allow you to label or categorize emails so you can track them in Netcore dashboards or reporting.
- When sending via SMTP, include a custom header (e.g.
X-Netcore-Tag: <tag_name>) or specific header that Netcore recognizes for tagging. - Ensure tag names conform to allowed patterns (alphanumeric, dashes/underscores) — check Netcore policy.
- Use tags for things like campaign names, environment (dev / staging / production), or type of email (confirmation, password reset, newsletters).
- Tags help in filtering and tracking in Netcore reporting.
Change Your SMTP Password
Follow the given steps to change your SMTP password.
- Log in to your Netcore dashboard.
- Navigate to Settings > Integrations or SMTP Credentials section.
- Locate the current SMTP password setting. Click Change Password.
- Generate/reset the password. Note: this will immediately affect any systems using the old password, so plan for downtime or coordinate deployments.
- Update your application / clients with the new password.
Summary
SMTP with Netcore gives you a flexible, reliable way to send emails using standard protocols. Key takeaways:
- Use
smtp.netcorecloud.netwith ports 25, 2525, or 587. - Turn on TLS/STARTTLS.
- Authenticate using valid username/password.
- Verify your sending domains.
- Use headers/tags for better tracking.
- Handle errors by checking credentials, network, and domain verification.
Updated about 4 hours ago
