Neo 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 with all the necessary configurations which you should know while configuring Neo on an email script.
alert-warning
To configure Neo on third-party apps, third-party email access must be enabled. Learn more here.
The emails sent using this script will append those emails to the Sent folder of your Neo webmail.
List of settings that can be provided for configuring Neo on Email Scripts
SMTP Host Name
smtp0001.neo.space
Port No
465
Encryption
SSL
Or
SMTP Host Name
smtp0001.neo.space
Port No
587
Encryption
STARTTLS
Or
SMTP Host Name
smtp0001.neo.space
Port No
25
Encryption
None
Code Snippets for reference
tabs
PHP
<?php // Include the PHPMailer library require 'vendor/autoload.php';
// Email configuration $sender_email = 'Your Neo email address'; $sender_password = 'Your Neo password'; $recipient_email = 'Recipient email'; $subject = 'Testing email script'; $body = 'This is a test email sent from a PHP script.';
// Set the email content $mail->setFrom($sender_email); $mail->addAddress($recipient_email); $mail->Subject = $subject; $mail->Body = $body;
// Send the email if ($mail->send()) { echo 'Email sent successfully.'; } else { echo 'Error sending email: ' . $mail->ErrorInfo; return; }
// Append the sent email to the IMAP server's "Sent" folder // Enable the IMAP extension from your php.ini file $imap_stream = imap_open("{" . $imap_server . ":" . $imap_port . "/ssl/novalidate-cert}", $sender_email, $sender_password); if ($imap_stream) { imap_append($imap_stream, "{" . $imap_server . ":" . $imap_port . "/ssl/novalidate-cert}Sent", $mail->getSentMIMEMessage()); echo 'Email appended to "Sent" folder.'; imap_close($imap_stream); } else { echo 'Error appending email to "Sent" folder.'; } } catch (Exception $e) { echo 'Error sending email: ' . $e->getMessage(); } }
// Call the function to send the email and append it to the "Sent" folder send_email(); ?>
Python
import smtplib import imaplib import time from email.mime.text import MIMEText from email.header import Header
# Email configuration sender_email = 'Your Neo email address' sender_password = 'Your Neo password' recipient_email = 'Recipient email' subject = 'Testing email script' body = 'This is a test email sent from a Python script.'
async function sendEmailAndAppend() { try { // Create a nodemailer transporter using SMTP const transporter = nodemailer.createTransport({ host: smtpServer, port: smtpPort, auth: { user: senderEmail, pass: senderPassword, }, });
// Create the email options const mailOptions = { from: senderEmail, to: recipientEmail, subject: subject, text: body, };
// Send the email const info = await transporter.sendMail(mailOptions); console.log('Email sent successfully.'); console.log('Info object:', info);
// Append the sent email to the "Sent" folder using IMAP const imap = new Imap({ user: senderEmail, password: senderPassword, host: imapServer, port: imapPort, tls: true, });
// Call the function to send the email and append it to the "Sent" folder sendEmailAndAppend();
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: Neo Mail cloud infra is blocking the client's IP
If there are continuously failed authentication attempts, we block the client's 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 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)/(25,None)
Get back to us with the output of the following commands
"telnet smtp0001.neo.space <port-no>" (omit the quotes)
"telnet Imap0001.neo.space <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 smtp0001.neo.space <port-no>" (omit the quotes)
"telnet Imap0001.neo.space <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 to these articles:
If you are using any other programming language, please let us know. So that we can provide you with the steps for that too :)
Hope this article has helped you.
Facing issues while configuring Neo on Email Scripts, contact us at hello@neo.space 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.