E-mail sent but no body
Posted: Fri Oct 19, 2007 6:33 pm
I am sending a single e-mail with the following code, the e-mail is sent but the message body content (plain text or HTML) does not come through. It just sends a blank e-mail. The to, from, and subject are all good, just the body is missing.
Any help would be greatly appreciated. I am using the following set up.
PHP = 4.4.7
Swift Mailer = 3.3.2 for php4
Thanks,
Chuck.
Code: Select all
<?php
ini_set('display_errors', '1');
error_reporting(E_ALL);
require_once ("swift/Swift.php");
require_once ("swift/Swift/Connection/Sendmail.php");
//Try to connect using /usr/sbin/sendmail -bs
#$swift =& new Swift(new Swift_Connection_Sendmail());
//Try to connect using a custom command
$swift =& new Swift(new Swift_Connection_Sendmail("/usr/sbin/sendmail -t"));
//Create the message
$message =& new Swift_Message("My subject", "My body");
if ($swift->send($message, "to@domain.com", "from@domain.net")) {
echo "Message sent";
} else {
echo "Message failed to send";
}
//It's polite to do this when you're finished
$swift->disconnect();
?>PHP = 4.4.7
Swift Mailer = 3.3.2 for php4
Thanks,
Chuck.