 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
amanoullah_n
Joined: 04 Oct 2006 Posts: 1
|
Posted: Wed Oct 04, 2006 7:49 am Post subject: Pear Mail body problem |
|
|
Hello every1 Im getting a pr!oblem with sending email using the PEAR Mail class. The mail is being sent okay but the body is always blank even if filled in! When the recipient gets the email, only the From, To and Subject appears with no problem. however nothing is displayd in the body. I have checked that the variable that stores the body text actually contains something by echoing it.It does!! But when the mail is sent, nothing appears in the body.Please help!
The code is as follows:
| Code: | <?
//get database connection
include "dbconnect.php";
?>
<?php
require_once "Mail.php";
$id = $_POST['txt_list_id'];
$name = $_POST['name'];
$from = "Amanoullah <amanoullah.nazir@networkplus.mu>";
$subject = $_POST['subject'];
$message = $_POST['message'];
//////////////// SMTP configuration ////////////
$host = //host goes here
$username = //username goes here
$password = //password goes here
/////////////////////////////////////////////
//the following will scan database to get recipient
$recipient_details = mysql_query("SELECT Name,Email FROM mailing_list WHERE List_ID = '$id' ");
$recipient = mysql_fetch_array($recipient_details);
$to = $recipient["Email"];
$headers = array ('From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => false, // set authentication true or false
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $message);
if (PEAR::isError($mail)) {
echo("<p>" . $mail->getMessage() . "</p>");
} else {
//success!
echo("<p>Message successfully sent to <strong>".$name." [".$email."]</strong></p>");
//redirect to mailing page
echo "<meta http-equiv='refresh' content='4;URL=admin_mailing_list.php'>";
}
?> |
I have checked the | Code: | | $message = $_POST['message']; | line and its okay as I have mentioned above..the subject displays fine..I dont get it. There dont seem to b any problem whatsoever in the Mail.php script as well. SMTP's wrking fine. Why is the body not showing?? ??? Please help! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|