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 = '';
Careful, there are multiple versions of PHPMailer around. I've never quite understood which is which. Anyway, this download of PHPMailer 5.1 definitely contains a setFrom
method:
public function SetFrom($address, $name = '',$auto=1) {
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With