Guys Look at this code require_once 'class.phpmailer.php'; $mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch $Body= "TestPay New Merchant Transaction Receipt\r\n\r\n\r\nINVOICE\r\n\r\nBelow is your transaction information an invoice is also attached for your records:\r\n\r\nMerchant Name on Acct -$fName - $lName\r\nMerchant Name on Acct -$fName - $lName\r\nReciept Serial No. - $random_number\r\nDTG of transaction - $timestamp\r\nName of Business - $BName\r\nAddress - $Adrs\r\nCity - $Cty\r\nState - $Ste\r\nZipcode - $zpc\r\nAcct Debited $mnysmbl 10.00 - **********$pacct\r\nInitial Product Set\r\n$proc1 - $procprc1 Shipping/Handling $shandpr1\r\n$proc2 - $procprc2 Shipping/Handling $shandpr2\r\n$proc3 - $procprc3 Shipping/Handling $shandpr3\r\n$proc4 - $procprc4 Shipping/Handling $shandpr4\r\n$proc5 - $procprc5 Shipping/Handling $shandpr5\r\n"; try { $mail->AddReplyTo('support@TestPay.com', 'TestPay-support-group'); $mail->AddAddress($eml, 'NewMerchant'); $mail->SetFrom('support@TestPay.com', 'TestPay-support-group'); $mail->AddReplyTo('support@TestPay.com', 'TestPay-support-group'); $mail->Subject = 'TestPay New Merchant Transaction Receipt'; //$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically $mail->MsgHTML(file_get_contents('')); //$mail->AddAttachment('invoice.doc'); // attachment //$mail->AddAttachment('Logo1Small.bmp'); // attachment $mail->Send(); echo "Message Sent OK</p>\n"; } catch (phpmailerException $e) { echo $e->errorMessage(); //Pretty error messages from PHPMailer } catch (Exception $e) { echo $e->getMessage(); //Boring error messages from anything else! } PHP: I keep getting "Message Body Empty" from PHPMailer - any ideas..??
Guys - Is it possible to send email with PHPMailer by making the text to be sent a variable. Meaning: $Body="text to be sent" Does it have to have a file to read. I just made a file called "Contents.html" and modified the code to read: $mail->MsgHTML(file_get_contents("Contents.html")); and the error that came back reads - Could not instantiate mail function
using the library? http://sourceforge.net/projects/phpmailer/ Code (markup): or do you mean something else?