Wow this frustrating.
I keep getting the same error: CCSender: Mailer was unable to send mailSMTP Error: The following recipients failed:
[email protected]
The lines I am editing are different and I am not sure if they all need the same edit.
Line 350 that looks like this:
$mail = new PHPMailer();
$mail->IsMail();
$mail->IsHTML($isHtml);
$mail->From = $modx->config['emailsender'];
$mail->FromName = $modx->config['site_name'];
$mail->Subject = $_lang['ef_mail_abuse_subject'];
$mail->Body = $body;
AddAddressToMailer($mail,"to",$modx->config['emailsender']);
$mail->send(); //ignore mail errors in this case
Is edited like so:
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = 'mail.sitename.com';
$mail->SMTPAuth = true;
$mail->Username = 'name';
$mail->Password = 'password';
$mail->IsHTML($isHtml);
$mail->From = $modx->config['[email protected]'];
$mail->FromName = $modx->config['site_name'];
$mail->Subject = $_lang['ef_mail_abuse_subject'];
$mail->Body = $body;
AddAddressToMailer($mail,"to",$modx->config['emailsender']);
$mail->send(); //ignore mail errors in this case
Line 442 that looked liked this:
$mail = new PHPMailer();
$mail->IsMail();
$mail->CharSet = $modx->config['modx_charset'];
$mail->IsHTML($isHtml);
$mail->From = $from;
$mail->FromName = $fromname;
$mail->Subject = $subject;
$mail->Body = $report;
AddAddressToMailer($mail,"replyto",$replyto);
AddAddressToMailer($mail,"to",$to);
AddAddressToMailer($mail,"cc",$cc);
AddAddressToMailer($mail,"bcc",$bcc);
AttachFilesToMailer($mail,$attachments);
if(!$mail->send()) return 'Main mail: ' . $_lang['ef_mail_error'] . $mail->ErrorInfo;
Now is edited like so:
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = 'mail.sitename.com';
$mail->SMTPAuth = true;
$mail->Username = 'name';
$mail->Password = 'password';
$mail->CharSet = $modx->config['modx_charset'];
$mail->IsHTML($isHtml);
$mail->From = $from;
$mail->FromName = $fromname;
$mail->Subject = $subject;
$mail->Body = $report;
AddAddressToMailer($mail,"replyto",$replyto);
AddAddressToMailer($mail,"to",$to);
AddAddressToMailer($mail,"cc",$cc);
AddAddressToMailer($mail,"bcc",$bcc);
AttachFilesToMailer($mail,$attachments);
if(!$mail->send()) return 'Main mail: ' . $_lang['ef_mail_error'] . $mail->ErrorInfo;
Line 460 that looked like this:
$mail = new PHPMailer();
$mail->IsMail();
$mail->CharSet = $modx->config['modx_charset'];
$mail->IsHTML($isHtml);
$mail->From = $from;
$mail->FromName = $fromname;
$mail->Subject = $subject;
$mail->Body = $report;
AddAddressToMailer($mail,"to",$fields['email']);
AttachFilesToMailer($mail,$attachments);
if(!$mail->send()) return 'CCSender: ' . $_lang['ef_mail_error'] . $mail->ErrorInfo;
Now is edited like this:
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = 'mail.sitename.com';
$mail->SMTPAuth = true;
$mail->Username = 'cnames';
$mail->Password = 'password';
$mail->CharSet = $modx->config['modx_charset'];
$mail->IsHTML($isHtml);
$mail->From = '[email protected]';
$mail->FromName = $fromname;
$mail->Subject = $subject;
$mail->Body = $report;
AddAddressToMailer($mail,"to",$fields['email']);
AttachFilesToMailer($mail,$attachments);
if(!$mail->send()) return 'CCSender: ' . $_lang['ef_mail_error'] . $mail->ErrorInfo;
Line 478 that looked like this:
$mail = new PHPMailer();
$mail->IsMail();
$mail->CharSet = $modx->config['modx_charset'];
$mail->IsHTML($isHtml);
$mail->From = ($autosender)? $autosender:$from;
$mail->FromName = ($autoSenderName)?$autoSenderName:$fromname;
$mail->Subject = $subject;
$mail->Body = $autotext;
AddAddressToMailer($mail,"to",$fields['email']);
if(!$mail->send()) return 'AutoText: ' . $_lang['ef_mail_error'] . $mail->ErrorInfo;
Is now edited like this: $mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = ’mail.sitename.com’;
$mail->SMTPAuth = true;
$mail->Username = ’name’;
$mail->Password = ’password’;
$mail->CharSet = $modx->config[’modx_charset’];
$mail->IsHTML($isHtml);
$mail->From = ($autosender)? $autosender:$from;
$mail->FromName = ($autoSenderName)?$autoSenderName:$fromname;
$mail->Subject = $subject;
$mail->Body = $autotext;
AddAddressToMailer($mail,"to",$fields[’email’]);
if(!$mail->send()) return ’AutoText: ’ . $_lang[’ef_mail_error’] . $mail->ErrorInfo;
Line 495 that looked like this:
$mail = new PHPMailer();
$mail->IsMail();
$mail->CharSet = $modx->config['modx_charset'];
$mail->IsHTML($isHtml);
$mail->From = $from;
$mail->FromName = $fromname;
$mail->Subject = $subject;
$mail->Body = $mobiletext;
AddAddressToMailer($mail,"to",$mobile);
$mail->send();
Is now edited like this:
$mail->IsSMTP();
$mail->Host = 'mail.sitename.com';
$mail->SMTPAuth = true;
$mail->Username = 'name';
$mail->Password = 'password';
$mail->CharSet = $modx->config['modx_charset'];
$mail->IsHTML($isHtml);
$mail->From = '[email protected]';
$mail->FromName = $fromname;
$mail->Subject = $subject;
$mail->Body = $mobiletext;
AddAddressToMailer($mail,"to",$mobile);
$mail->send();
So, there is variation in how the From code is put together.
Am I close?
AFAIK, the host convention here is Host=’mail.sitename.com’ and the From=’
[email protected]’
It looks like the script and the snippet call is working, the messages are being received. The only glitch is the "CCSender: Mailer was unable to send mailSMTP Error: The following recipients failed:
[email protected]" error message...
In this case the address that is referred to as the "recipients failed" is the address that the sender uses in the front end of the form? Why?
Sorry, going around the bend. This stupid thing has eaten up two days already...