Hi all,
I have recently set up a Drupal website. I am a beginner. My shared host server does not allow nobody@localhost to send emails, and prevents access to php.ini, so I spent some time getting a SMTP script running. While the Drupal feedback module and the new account creation works fine in terms of sending of mails, I am having some problems with the sending of password reminder emails.
warning: Cannot modify header information - headers already sent by (output started at /home/affyorg/public_html/cancer/content/mail.php:20) in /home/affyorg/public_html/cancer/content/includes/common.inc on line 192.
Your advice would be appreciated. Thanks!!
My mail.php file is as follows:
<?
include("Mail.php");
$recipients = $mail;
$headers["To"] = $mail;
$headers["From"] = "abc@xyz.org";
$headers["Subject"] = $subject;
$body = str_replace("\n", "\r\n", $message);
$params["host"] = "mail.xyz.org";
$params["port"] = "25";
$params["auth"] = true;
$params["username"] = "abc@xyz.org";
$params["password"] = "defgh";
// Create the mail object using the Mail::factory method
$mail_object =& Mail::factory("smtp", $params);
$mail_object->send($recipients, $headers, $body);
?>
Line 189 - 192 of common.inc is
// Before the redirect, allow modules to react to the end of the page request.
module_invoke_all('exit', $url);
header('Location: '. $url);