PHPMailer erroring out with Call to undefined method PHPMailer::SetFrom()

Posted by dotty on Stack Overflow See other posts from Stack Overflow or by dotty
Published on 2010-03-24T15:52:25Z Indexed on 2010/03/24 16:03 UTC
Read the original article Hit count: 477

Filed under:
|
|

Hay I'm using PHPMailer to send some simple emails, however the function SetFrom() doesn't seem to work, even though the code I'm using is straight from phpmails docs (http://phpmailer.worxware.com/index.php?pg=examplebmail)

Here my error

Call to undefined method PHPMailer::SetFrom()

and my script

require_once('inc/phpmailer/class.phpmailer.php');
$mail = new PHPMailer(); // defaults to using php "mail()"
$body = $message;
$mail->SetFrom('[email protected]', 'tell a friend');
$mail->AddAddress($to_email, $to);
$mail->Subject = "tell a friend";
$mail->MsgHTML($body);
$mail->Send();

Any ideas?

EDIT

turns out the SetFrom() function doesnt exist in my version of phpmailer, i can set these values using

$mail->From = '';
$mail->FromName = '';

© Stack Overflow or respective owner

Related posts about php

Related posts about mail