$config['useragent'] = 'PHPMailer'; // Mail engine switcher: 'CodeIgniter' or 'PHPMailer'
$config['protocol'] = 'smtp'; // 'mail', 'sendmail', or 'smtp'
//$config['mailpath'] = '/usr/sbin/sendmail';
$config['smtp_host'] = 'ssl0.ovh.net';
$config['smtp_user'] = 'jor...@cfdt49.fr';
$config['smtp_pass'] = '*********';
$config['smtp_port'] = 465;
$config['smtp_timeout'] = 30; // (in seconds)
$config['smtp_crypto'] = 'ssl'; // '' or 'tls' or 'ssl'
$config['smtp_debug'] = 0; // PHPMailer's SMTP debug info level: 0 = off, 1 = commands, 2 = commands and data, 3 = as 2 plus connection status, 4 = low level data output.
$config['smtp_auto_tls'] = FALSE; // Whether to enable TLS encryption automatically if a server supports it, even if `smtp_crypto` is not set to 'tls'.
$config['smtp_conn_options'] = array(); // SMTP connection options, an array passed to the function stream_context_create() when connecting via SMTP.
$config['wordwrap'] = TRUE;
$config['_smtp_auth'] = TRUE;
$config['wrapchars'] = 76;
$config['mailtype'] = 'html'; // 'text' or 'html'
$config['charset'] = 'UTF-8'; // 'UTF-8', 'ISO-8859-15', ...; NULL (preferable) means config_item('charset'), i.e. the character set of the site.
$config['validate'] = TRUE;
$config['priority'] = 3; // 1, 2, 3, 4, 5; on PHPMailer useragent NULL is a possible option, it means that X-priority header is not set at all, see https://github.com/PHPMailer/PHPMailer/issues/449
$config['crlf'] = "\n"; // "\r\n" or "\n" or "\r"
$config['newline'] = "\n"; // "\r\n" or "\n" or "\r"
$config['bcc_batch_mode'] = FALSE;
$config['bcc_batch_size'] = 200;
$config['encoding'] = '8bit'; if (EMAIL_ADDRESS == '') {
echo '<b>ERROR:</b> Please provide a valid e-mail address in testmail.php.<br />' . PHP_EOL;
} else {
if ($configFileExists && $configCIFileExists) {
echo '1';
include $pathCIConfigFile;
include $pathConfigFile;
try {
//Include shipped PHPMailer library
$phpmailerLib = realpath(join(DIRECTORY_SEPARATOR, array('application', 'third_party', 'PHPMailer', 'PHPMailerAutoload.php')));
echo '1.1';
require_once $phpmailerLib;
echo '1.2';
$mail = new PHPMailer(true); //true => throw exceptions on error
$mail->SMTPDebug = 2; //Debug informations
$mail->Debugoutput = function($str, $level) {
echo nl2br($str);
};
echo '2';
//Test if we use SMTP protocol
if (strcasecmp($config['protocol'], 'smtp') == 0) {
echo '<b>INFO:</b> Selecting SMTP Protocol.<br />' . PHP_EOL;
$mail->IsSMTP();
$mail->Host = $config['smtp_host'];
$mail->Port = $config['smtp_port'];
if (strpos($config['smtp_port'], 'gmail') !== false) {
echo '<b>INFO:</b> Using GMAIL.<br />' . PHP_EOL;--
You received this message because you are subscribed to the Google Groups "jorani" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jorani+unsubscribe@googlegroups.com.
To post to this group, send email to jor...@googlegroups.com.
Visit this group at https://groups.google.com/group/jorani.
To view this discussion on the web visit https://groups.google.com/d/msgid/jorani/e1e97e41-861e-48d1-838b-ce5f203e70ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
$config['_smtp_auth'] = TRUE;
$config['smtp_crypto'] = 'ssl'; $config['smtp_crypto'] = ''; --
You received this message because you are subscribed to the Google Groups "jorani" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jorani+unsubscribe@googlegroups.com.
To post to this group, send email to jor...@googlegroups.com.
Visit this group at https://groups.google.com/group/jorani.
To view this discussion on the web visit https://groups.google.com/d/msgid/jorani/5d3252d4-5dc6-40e7-8efd-2552472fc20a%40googlegroups.com.
<?php defined('BASEPATH') OR exit('No direct script access allowed.');
$config['useragent'] = 'PHPMailer'; // Mail engine switcher: 'CodeIgniter' or 'PHPMailer'
$config['protocol'] = 'smtp'; // 'mail', 'sendmail', or 'smtp'
//$config['mailpath'] = '/usr/sbin/sendmail';
$config['smtp_host'] = 'ssl0.ovh.net';
$config['smtp_port'] = 465;
$config['smtp_timeout'] = 30; // (in seconds)
$config['smtp_crypto'] = 'ssl'; // '' or 'tls' or 'ssl'
$config['smtp_debug'] = 0; // PHPMailer's SMTP debug info level: 0 = off, 1 = commands, 2 = commands and data, 3 = as 2 plus connection status, 4 ...
$config['smtp_auto_tls'] = FALSE; // Whether to enable TLS encryption automatically if a server supports it, even if `smtp_crypto` is not set to 'tls'.
$config['smtp_conn_options'] = array(); // SMTP connection options, an array passed to the function stream_context_create() when connecting via SMTP.
$config['wordwrap'] = TRUE;
$config['wrapchars'] = 76;
$config['mailtype'] = 'html'; // 'text' or 'html'
$config['charset'] = 'UTF-8'; // 'UTF-8', 'ISO-8859-15', ...; NULL (preferable) means config_item('charset'), i.e. the character set of the site.
$config['validate'] = TRUE;
$config['priority'] = 3; // 1, 2, 3, 4, 5; on PHPMailer useragent NULL is a possible option, it means that X-priority header is not set at all, ...
$config['crlf'] = "\n"; // "\r\n" or "\n" or "\r"
$config['newline'] = "\n"; // "\r\n" or "\n" or "\r"
$config['bcc_batch_mode'] = FALSE;
$config['bcc_batch_size'] = 200;
$config['encoding'] = '8bit'; // The body encoding. For CodeIgniter: '8bit' or '7bit'. For PHPMailer: '8bit', '7bit', 'binary', 'base64', or 'quoted-printable'.
// DKIM Signing
// See https://yomotherboard.com/how-to-setup-email-server-dkim-keys/
// See http://stackoverflow.com/questions/24463425/send-mail-in-phpmailer-using-dkim-keys
// See https://github.com/PHPMailer/PHPMailer/blob/v5.2.14/test/phpmailerTest.php#L1708
$config['dkim_domain'] = ''; // DKIM signing domain name, for exmple 'example.com'.
$config['dkim_private'] = ''; // DKIM private key, set as a file path.
$config['dkim_private_string'] = ''; // DKIM private key, set directly from a string.
$config['dkim_selector'] = ''; // DKIM selector.
$config['dkim_passphrase'] = ''; // DKIM passphrase, used if your key is encrypted.
$config['dkim_identity'] = ''; // DKIM Identity, usually the email address used as the source of the email.To unsubscribe from this group and stop receiving emails from it, send an email to jorani+un...@googlegroups.com.
To post to this group, send email to jor...@googlegroups.com.
Visit this group at https://groups.google.com/group/jorani.
Vous souhaitez envoyer un e-mail via un script PHP en utilisant le protocole SMTP.
Suite aux vérifications, je constate que vous avez un hébergement mutualisé Perso associé au domaine et que votre configuration MX est bien correcte.
En effet, d'une façon générale, si vous souhaitez envoyer des e-mails depuis votre hébergement, je vous recommande plutôt d'utiliser la fonction Mail de PHP qui est mieux adaptée à ce genre d'envoi et qui n'est pas soumises aux restrictions d'envoi imposées par les e-mails mutualisés.
D'ailleurs, vous pouvez contrôler et visualiser les 100 dernières tentatives d'envoi avec erreur directement depuis votre espace client, en suivant la démarche suivante :
Espace client >> Hébergements >> Plus + >> Script emails >> Emails en erreurs.
Pour plus d'informations concernant le suivi des e-mails automatisés, je vous invite à consulter le guide suivant :
https://docs.ovh.com/fr/fr/web/hosting/suivi-emails-automatises/
Par ailleurs, si vous souhaitez tout de même utiliser l'envoi via SMTP, cela est tout à fait possible et dans ce cas, je vous recommande d'utiliser le port 587 au lieu du 465.
Voici les informations détaillées pour la configuration d’un compte e-mail en IMAP .
Configuration IMAP avec sécurisation SSL activée ou désactivée :
Adresse Email : Votre adresse e-mail mutualisée entière.
Mot de passe : Le mot de passe que vous avez défini dans l’espace client.
Nom d’utilisateur : Votre adresse e-mail mutualisé entière.
Serveur entrant : Le serveur de réception des e-mails : SSL0.OVH.NET
Port serveur entrant : Le port du serveur entrant : 993 ou 143
Serveur sortant : Le serveur d’envoi des e-mails : SSL0.OVH.NET
Port serveur sortant : Le port du serveur sortant : 465 ou 587
Notez bien que les ports 110 et 587 correspondent à la sécurisation SSL désactivée. Les ports 995 et 465 correspondent à la sécurisation SSL activée.
<?php defined('BASEPATH') OR exit('No direct script access allowed.');
$config['useragent'] = 'PHPMailer'; // Mail engine switcher: 'CodeIgniter' or 'PHPMailer'$config['protocol'] = 'smtp'; // 'mail', 'sendmail', or 'smtp'//$config['mailpath'] = '/usr/sbin/sendmail';$config['smtp_host'] = 'ssl0.ovh.net';$config['smtp_user'] = 'n...@domaine.fr';$config['smtp_pass'] = 'motdepasse';$config['smtp_port'] = 587;$config['smtp_timeout'] = 30; // (in seconds)$config['smtp_crypto'] = ''; // '' or 'tls' or 'ssl'$config['smtp_debug'] = 0; // PHPMailer's SMTP debug info level: 0 = off, 1 = commands, 2 = commands and data, 3 = as 2 plus connection status, 4 = low level data output.$config['smtp_auto_tls'] = FALSE; // Whether to enable TLS encryption automatically if a server supports it, even if `smtp_crypto` is not set to 'tls'.$config['smtp_conn_options'] = array(); // SMTP connection options, an array passed to the function stream_context_create() when connecting via SMTP.$config['wordwrap'] = TRUE;$config['_smtp_auth'] = TRUE;$config['wrapchars'] = 76;$config['mailtype'] = 'html'; // 'text' or 'html'$config['charset'] = 'UTF-8'; // 'UTF-8', 'ISO-8859-15', ...; NULL (preferable) means config_item('charset'), i.e. the character set of the site.$config['validate'] = TRUE;$config['priority'] = 3; // 1, 2, 3, 4, 5; on PHPMailer useragent NULL is a possible option, it means that X-priority header is not set at all, see https://github.com/PHPMailer/PHPMailer/issues/449$config['crlf'] = "\n"; // "\r\n" or "\n" or "\r"$config['newline'] = "\n"; // "\r\n" or "\n" or "\r"$config['bcc_batch_mode'] = FALSE;$config['bcc_batch_size'] = 200;$config['encoding'] = '8bit'; // The body encoding. For CodeIgniter: '8bit' or '7bit'. For PHPMailer: '8bit', '7bit', 'binary',