PHPMailer only working in certain situations

My website URL is:

mangosafariband.com

What I’m seeing is:

If I use PHPMailer for my gmail account, and the body is

$mail->Body = ‘This is a plain-text message body’; // Set a plain text body.

it will correctly send me an email.

However, if I add in php post elements like

$emailInput = $_POST[‘Email’];

$merchInput = $_POST[‘merch-input’];

$mail->Body = "

“.$emailInput.” , “.$merchInput.”


";

the email still sends, but I do not receive it in my inbox.

You may need to use the HTML type of emails if the plain text one doesn’t work on PHPMailer. For example:

$emailInput = $_POST['email'];
$merchInput = $_POST['merch-input'];
$mail->isHTML(true);
$mail->Body = "
               ##          
 ".$emailInput." , ".$merchInput."
               ##          
 ";
$mail->AltBody = "It may not work when using a plain text client. Please upgrade to an HTML email client.";

Still doesn’t work, but email is definitely sent.

I get Oops… the system encountered a problem (#001) from google when trying to load my email.

actually ur first suggestion worked thank u

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.