Business Email can be configured on Email scripts using various coding languages. The major objective for doing this is to customize a contact form present on a website.
This article provides you all the necessary configurations which you should know while configuring Business Mail on an email script.
List of settings that can be provided for configuring Business Mail on Email Scripts
SMTP Host Name | SMTP.titan.email |
Port No | 465 |
Encryption | SSL |
Or
SMTP Host Name | SMTP.titan.email |
Port No | 587 |
Encryption | STARTTLS |
Code Snippets for reference
PHP
require_once "Mail.php";
$username = 'Your Business Mail Email address';
$password = 'Your Business Mail password';
$smtpHost = 'ssl://smtp.titan.email';
$smtpPort = '465';
$to = 'Receiver email';
$from = 'Sender email';
//Note - To and From address should not be the same
$subject = 'Contact Form';
$successMessage = 'Message successfully sent!';
$replyTo = '';
$name = '';
$body = '';
$headers = array(
'From' => $name . " <" . $from . ">",
'To' => $to,
'Subject' => $subject
);
$smtp = Mail::factory('smtp', array(
'host' => $smtpHost,
'port' => $smtpPort,
'auth' => true,
'username' => $username,
'password' => $password
));
$mail = $smtp->send($to, $headers, $body);
if (PEAR::isError($mail)) {
echo($mail->getMessage());
} else {
echo($successMessage);
}
Python
import smtplib
import ssl
from email.mime.text import MIMEText
smtp_server = "smtp.titan.email"
smtp_port = 465
sender = "xyz@abc.com"
password = "XXXXXXX"
recipients = ["hello@abc.com"]
context = ssl.create_default_context()
s = smtplib.SMTP_SSL(smtp_server, smtp_port, context)
s.set_debuglevel(1)
s.ehlo()
s.login(sender, password)
msg = MIMEText("""Hey, this is test body""")
msg['From'] = sender
msg['To'] = ", ".join(recipients)
msg['Subject'] = "test subject"
s.sendmail(sender, recipients, msg.as_string())
s.close()
Node Mailer
"use strict";
const nodemailer = require("nodemailer");
function main() {
let transporter = nodemailer.createTransport({
host: "smtp.titan.email",
port: 465,
secure: true,
auth: {
user: "test@domain.com",
pass: "XXXXXXX",
},
});
let info = transporter.sendMail({
from: '"User" <test@domain.com>',
to: "recipient@domain.com",
subject: "Hello",
text: "Hello world?",
html: "<b>Hello world?</b>",
});
console.log("Message sent: %s", info.messageId);
}
main();
If the above settings are not working from an Email client or Script it should be happening because of the below-mentioned cases
Case 1: Business Mail cloud infra is blocking the client IP
If there are continuously failed authentication attempts, we block the client IP
- If you are is trying to connect from your local machine, Kindly get back to us with the public IP by accessing https://www.whatismyip.com/
- If you are trying to connect from the Webhosting, Kindly contact the system administrator and get back to us with the Server's public IP
Case 2: Client is blocking the port connection at their end ( Port is blocked at the firewall)
If you are is trying to connect from your local machine
Kindly use a different port combination: (465,SSL)/(587,STARTTLS)
Get back to us with the output of the following commands
- "telnet SMTP.titan.email <port-no>" (omit the quotes)
- "telnet IMAP.titan.email <port-no>" (omit the quotes)
If you are trying to connect from the Webhosting
Contact the server admins to get back to us with the output of the following command
- "telnet SMTP.titan.email <port-no>" (omit the quotes)
- "telnet IMAP.titan.email <port-no>" (omit the quotes)
You must first enable telnet commands in order to run telnet commands. For information on how to enable telnet commands for your specific operating system, kindly refer these articles:
- Windows: https://www.technipages.com/windows-10-enable-telnet
- MacOS: https://www.layerstack.com/resources/tutorials/Installing-Telnet-Client-on-macOS
- Linux:https://www.baeldung.com/linux/telnet#:~:text=The%20telnet%20command%20is%20a,sends%20information%20in%20plain%20text.
If you are using any other coding language, feel free to let us know. So that we can provide you the steps for that too :)
Hope this article has helped you.
Facing issues while configuring Business Mail on Email Scripts, contact us at support@onlydomains.com along with the screenshot of the configuration you are using and the error message you are receiving. We will help you in every possible way.