Bonjour,
J'ai une variable $corp_mail qui reçoit tout le message.
J'utilise PHPMailer comme suit en HTML :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| // Création d'un nouvel objet $mail
$mail = new PHPMailer();
$mail->setLanguage('fr','classes/PHPMailer/language/phpmailer.lang-fr.php');
$mail->IsHTML(true);
$mail->CharSet = "UTF-8";
$mail->setFrom($expediteur, $lib_expediteur);
$mail->AddReplyTo($expediteur);
$mail->Subject = $sujet;
$mail->MsgHTML($corp_mail);
$mail->addAddress($unDest);
$mail->Send(); |
Avant que j'insère un lien hypertexte, pas de souci, le mail est bien reçu correctement.
Quand j'ajout le lien,
$corp_mail .= $corp_mail. "<a href='http://http://www.xxxx.asso.fr'>ici</a>";
là patatraque ... j'ai l'erreur :Could not instantiate mail function
En mettant $mai dans var_dump, je vois :
"CustomHeader":protected]=> array(0) { } ["lastMessageID":protected]=> string(50) "" ["message_type":protected]=> string(3) "alt" ["boundary":protected]=> array(3) { [1]=> string(35) "b1_b348feeaf0cb2fe7f6fd30121ce0b5e0" [2]=> string(35) "b2_b348feeaf0cb2fe7f6fd30121ce0b5e0" [3]=> string(35) "b3_b348feeaf0cb2fe7f6fd30121ce0b5e0" } ["language":protected]=> array(19) { ["authenticate"]=> string(35) "SMTP Error: Could not authenticate." ["connect_host"]=> string(43) "SMTP Error: Could not connect to SMTP host." ["data_not_accepted"]=> string(30) "SMTP Error: data not accepted." ["empty_message"]=> string(18) "Message body empty" ["encoding"]=> string(18) "Unknown encoding: " ["execute"]=> string(19) "Could not execute: " ["file_access"]=> string(23) "Could not access file: " ["file_open"]=> string(33) "File Error: Could not open file: " ["from_failed"]=> string(35) "The following From address failed: " ["instantiate"]=> string(36) "Could not instantiate mail function." ["invalid_address"]=> string(17) "Invalid address: " ["mailer_not_supported"]=> string(25) " mailer is not supported." ["provide_address"]=> string(54) "You must provide at least one recipient email address." ["recipients_failed"]=> string(45) "SMTP Error: The following recipients failed: " ["signing"]=> string(15) "Signing Error: " ["smtp_connect_failed"]=> string(22) "SMTP connect() failed." ["smtp_error"]=> string(19) "SMTP server error: " ["variable_set"]=> string(30) "Cannot set or reset variable: " ["extension_missing"]=> string(19) "Extension missing: " } ["error_count":protected]=> int(1) ["sign_cert_file":protected]=> string(0) "" ["sign_key_file":protected]=> string(0) "" ["sign_extracerts_file":protected]=> string(0) "" ["sign_key_pass":protected]=> string(0) "" ["exceptions":protected]=> bool(false) ["uniqueid":protected]=> string(32) "b348feeaf0cb2fe7f6fd30121ce0b5e0" }
Pourquoi j'ai :
"Could not access file:
Invalid address:
SMTP Error: The following recipients failed
Si j'enlève :
<a href='http://http://www.xxxx.asso.fr'>ici</a>
ça refonctionne.
Avez-vous une explication ?
Merci de votre aide.
Eddy
Partager