SMTPDebug = 2; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'sg2plzcpnl453268.prod.sin2.secureserver.net'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'test@cutandfab.com.au'; // SMTP username $mail->Password = 'Cutandfab789!'; // SMTP password $mail->SMTPSecure = 'tls'; // Enable TLS encryption, [ICODE]ssl[/ICODE] also accepted $mail->Port = 587; // TCP port to connect to //Recipients $mail->setFrom('test@cutandfab.com.au', 'Mailer'); $mail->addAddress('ashishraj09@gmail.com'); // Add a recipient //$mail->addAddress(''); // Name is optional //$mail->addReplyTo('test@cutandfab.com.au', 'test'); //$mail->addCC('cc@example.com'); //$mail->addBCC('bcc@example.com'); // Attachments // $mail->addAttachment('/home/cpanelusername/attachment.txt'); // Add attachments //$mail->addAttachment('/home/cpanelusername/image.jpg', 'new.jpg'); // Optional name // Content $mail->isHTML(true); // Set email format to HTML $mail->Subject = 'Here is the subject'; $mail->Body = 'This is the HTML message body Mailer.php'; $mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; $mail->DKIM_domain = 'cutandfab.com.au'; $mail->DKIM_private = '/home/aebfwdn2r0df/private.key'; $mail->DKIM_selector = 'phpmailer'; $mail->DKIM_passphrase = ''; $mail->DKIM_identity = $mail->From; $mail->send(); echo 'Message has been sent'; } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; }