eliteel5
Member
- Messages
- 50
- Reaction score
- 1
- Points
- 8
Id like to thank all for their assistance and patience with me regarding using X10 email services
A special word of thanks to mrburnsx for the valuable input issued
This is what I found as error in my coding for those wishing to set up this service
This beats trying to set up oa2auth which is one headache and half
1: Ensure your https certificate is valid if not renew this via the CPanel
2:
A . Enable DKIM
Email Accounts > Enable DKIM
B. SPF Record missing a sending IP Address
Locate your TXT Record in DNS Management containing v=spf1 and add one of the following to it (ip4:198.91.80.251 or a:edge.x10hosting.com)
C. DMARC Record missing
In Account Manager > DNS Management > Add Record (Name: _dmarc, Type: TXT, TXT Record Type: DMARC), the hosting control panel will walk you through the process.
Next goto GitHub and download the PHPMailer package
Here is the address PHPMailer
Unzip this folder to your local hardrive where you are composing your website eg as example mine might be X10Website
Next : Use this code below to create your mail script and name its to something like send_mail.php
A very big thank you to all now hopefully I can complete the rest
[CODE
]<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>check for sendmail</title>
</head>
<body>
<?php
/* Lines 12 to 13 assist with debugging actual code */
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
/* Lines 20 to 22 are for the classes that you will be using for
* your php mail code
*/
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\SMTP;
/* Lines 29 to 33 These lines load the actual PHP files that define the PHPMailer classes.
* __DIR__ is a special PHP constant that returns the current directory path.
* This ensures the path is always correct regardless of how the script is run.
*/
require __DIR__ . '/PHPMailer/src/Exception.php';
require __DIR__ . '/PHPMailer/src/PHPMailer.php';
require __DIR__ . '/PHPMailer/src/SMTP.php';
/* Create a new PHPMailer object
* This creates an instance of the PHPMailer class.
* The true enables exceptions, so if anything goes wrong, you can catch it using a try...catch block.
*/
$mail = new PHPMailer(true);
try {
//Server settings
$mail->SMTPDebug = SMTP:
EBUG_SERVER; // Enables verbose debugging to see all connection details between your script and the mail server.
$mail->isSMTP(); // Tells PHPMailer to use SMTP (not default mail() function).
$mail->Host = 'mail.eliteprojects.x10host.com'; // the X10 mail server
$mail->SMTPAuth = true; // Tells PHPMailer to use login authentication (username + password).
$mail->Username = 'eliteel5'; // your full x10Hosting log on name
$mail->Password = '********'; // Your x10Hosting email password im unsures as to what this could be need to check
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Use STARTTLS to secure the connection.
$mail->Port = 587 ; // Standard port for TLS
//Recipients
$mail->setFrom('eliteel5@eliteprojects.x10host.com', 'Elite Projects'); // from whom i.e yourself
$mail->addAddress('elite2012.mh@gmail.com', 'Mark Harrington'); // change to your recipient
// Content
$mail->isHTML(false); // This means you're sending plain text, not HTML.
$mail->Subject = 'Test message via x10hosting SMTP'; // Email subject line.
/* Actual message you are sending */
$mail->Body = "Hello,\nThis is a test message sent using PHPMailer through x10Hosting SMTP server.";
$mail->send(); // Sends the email. If successful, it echoes confirmation.
echo 'Message sent successfully!';
// Finally catch exceptions .ie bad password , incorrect log on name etc
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
?>
<!-- Thats is folks ensure this file sits above your directory PHPMailer and hope this helps all -->
</body>
</html>
[/CODE]
A special word of thanks to mrburnsx for the valuable input issued
This is what I found as error in my coding for those wishing to set up this service
This beats trying to set up oa2auth which is one headache and half
1: Ensure your https certificate is valid if not renew this via the CPanel
2:
A . Enable DKIM
Email Accounts > Enable DKIM
B. SPF Record missing a sending IP Address
Locate your TXT Record in DNS Management containing v=spf1 and add one of the following to it (ip4:198.91.80.251 or a:edge.x10hosting.com)
C. DMARC Record missing
In Account Manager > DNS Management > Add Record (Name: _dmarc, Type: TXT, TXT Record Type: DMARC), the hosting control panel will walk you through the process.
Next goto GitHub and download the PHPMailer package
Here is the address PHPMailer
Unzip this folder to your local hardrive where you are composing your website eg as example mine might be X10Website
Next : Use this code below to create your mail script and name its to something like send_mail.php
A very big thank you to all now hopefully I can complete the rest
[CODE
]<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>check for sendmail</title>
</head>
<body>
<?php
/* Lines 12 to 13 assist with debugging actual code */
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
/* Lines 20 to 22 are for the classes that you will be using for
* your php mail code
*/
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
use PHPMailer\PHPMailer\SMTP;
/* Lines 29 to 33 These lines load the actual PHP files that define the PHPMailer classes.
* __DIR__ is a special PHP constant that returns the current directory path.
* This ensures the path is always correct regardless of how the script is run.
*/
require __DIR__ . '/PHPMailer/src/Exception.php';
require __DIR__ . '/PHPMailer/src/PHPMailer.php';
require __DIR__ . '/PHPMailer/src/SMTP.php';
/* Create a new PHPMailer object
* This creates an instance of the PHPMailer class.
* The true enables exceptions, so if anything goes wrong, you can catch it using a try...catch block.
*/
$mail = new PHPMailer(true);
try {
//Server settings
$mail->SMTPDebug = SMTP:
$mail->isSMTP(); // Tells PHPMailer to use SMTP (not default mail() function).
$mail->Host = 'mail.eliteprojects.x10host.com'; // the X10 mail server
$mail->SMTPAuth = true; // Tells PHPMailer to use login authentication (username + password).
$mail->Username = 'eliteel5'; // your full x10Hosting log on name
$mail->Password = '********'; // Your x10Hosting email password im unsures as to what this could be need to check
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Use STARTTLS to secure the connection.
$mail->Port = 587 ; // Standard port for TLS
//Recipients
$mail->setFrom('eliteel5@eliteprojects.x10host.com', 'Elite Projects'); // from whom i.e yourself
$mail->addAddress('elite2012.mh@gmail.com', 'Mark Harrington'); // change to your recipient
// Content
$mail->isHTML(false); // This means you're sending plain text, not HTML.
$mail->Subject = 'Test message via x10hosting SMTP'; // Email subject line.
/* Actual message you are sending */
$mail->Body = "Hello,\nThis is a test message sent using PHPMailer through x10Hosting SMTP server.";
$mail->send(); // Sends the email. If successful, it echoes confirmation.
echo 'Message sent successfully!';
// Finally catch exceptions .ie bad password , incorrect log on name etc
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
?>
<!-- Thats is folks ensure this file sits above your directory PHPMailer and hope this helps all -->
</body>
</html>
[/CODE]
Last edited: