Message could not be sent. Mailer Error: Invalid address: (cc):
$mail = new PHPMailer(true); // Passing `true` enables exceptions try { //Server settings //$mail->SMTPDebug = 2; // Enable verbose debug output $mail - > isSMTP(); // Set mailer to use SMTP $mail - > Host = 'mail.smtp2go.com'; // Specify main and backup SMTP servers $mail - > SMTPAuth = true; // Enable SMTP authentication $mail - > Username = 'xxx'; // SMTP username $mail - > Password = 'xxx'; // SMTP password $mail - > SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted $mail - > Port = 2525; // TCP port to connect to //Recipients $mail - > AllowEmpty = true; $mail - > setFrom('adrian@ic-express.co.za', 'Adrian Boshoff'); //$mail->addAddress($mrow['email']); //This is an example of creating a variable from an array field $mail - > addAddress($email); //This is an example of creating a variable from an array field $mail - > addReplyTo('adrian@ic-express.co.za'); $mail - > addCC($addemail); $mail - > AllowEmpty = true; //$mail->addBCC('adrian@ic-express.co.za'); //Attachments $mail - > addAttachment('eco.pdf'); // Add attachments //$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); // Optional name $mail - > isHTML(true); // Set email format to HTML $mail - > Subject = $subject; $mail - > Body = << < END < !doctype html > < html xmlns = "http://www.w3.org/1999/xhtml" xmlns: v = "urn:schemas-microsoft-com:vml" xmlns: o = "urn:schemas-microsoft-com:office:office" > < head > <!-- NAME: SELL PRODUCTS -->
$mail->AllowEmpty = true;
$addemail
$mail->addCC('example@example.com');
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)