Geir wrote:
> Hi
> I need to use sendmail's -f switch in the wrapper at the end of this
> message. Where / how do I put it?
> -f <address>
> This option sets the address of the envelope sender of a
> locally-generated message (also known as the return path).
> The option can normally be used only by a trusted user, but
> untrusted_set_sender can be set to allow untrusted users to
> use it.
> regards geir
> Code:
> require_once('../class.phpmailer.php');
> $mail = new PHPMailer(); // defaults to using php "mail()"
> $mail->IsSendmail(); // telling the class to use SendMail transport
> $body = file_get_contents('contents.html');
> $body = eregi_replace("[\]",'',$body);
> $mail->AddReplyTo("n...@yourdomain.com","First Last");
> $mail->SetFrom('n...@yourdomain.com', 'First Last');
> $mail->AddReplyTo("n...@yourdomain.com","First Last");
> $address = "wh...@otherdomain.com";
> $mail->AddAddress($address, "John Doe");
> $mail->Subject = "PHPMailer Test Subject via Sendmail, basic";
> $mail->AltBody = "To view the message, please use an HTML compatible
> email viewer!"; // optional, comment out and test
> $mail->MsgHTML($body);
> $mail->AddAttachment("images/phpmailer.gif"); // attachment
> $mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
> if(!$mail->Send()) {
> echo "Mailer Error: " . $mail->ErrorInfo;
> } else {
> echo "Message sent!";
> }
Try using the simple mail() function, rather than the class object.