trillion Posted September 27, 2006 Share Posted September 27, 2006 I am trying the tutorial here: http://www.phpfreaks.com/tutorials/130/0.phpto set up php email using phpmailer.It works fine for basic text email but when I get to the part to add html body content I get this error:Fatal error: Call to undefined function: body() in /home/user/public_html/dir/dir/mailto-html.php on line 21the code looks like this:[code]require_once('../config.php');require_once('MailClass.inc');$mailer = new IDMailer();$mailer->Subject = 'This is a Test';$htmlBody = '<html><head><title>HTML Tst Ml</title></head><body><img src="http://phpfreaks.com/images/phpfreaks_logo.php" /><br /><h2>PHP Rocks!</h2><p>We text text text text text text text text text text text text<a href="http://inherentdesign.com>ID</a> text text text text text</p>';$textBody = 'Hopefully I will not see this';$mailer->Body($htmlBody);$mailer->isHTML(true);$mailer->AltBody($textBody);[/code]there is more under this but above is what seems relevant to the issue as I get the error at line[code]$mailer->Body($htmlBody);[/code]If I comment out the function body()I get a similar error for function altbody()what have I gotten wrong? Link to comment https://forums.phpfreaks.com/topic/22284-phpmailer-undefined-function/ Share on other sites More sharing options...
trillion Posted September 28, 2006 Author Share Posted September 28, 2006 OKThere was a bug in the tutorial.here is the fix.change:[code]$mailer->Body($htmlBody);[/code]to:[code]$mailer->Body = $htmlBody;[/code]and change:[code]$mailer->AltBody($textBody);[/code]to:[code]$mailer->AltBody = $textBody;[/code]now it works Link to comment https://forums.phpfreaks.com/topic/22284-phpmailer-undefined-function/#findComment-100015 Share on other sites More sharing options...
HuggieBear Posted September 28, 2006 Share Posted September 28, 2006 Thanks for the update Trillion.RegardsHuggie Link to comment https://forums.phpfreaks.com/topic/22284-phpmailer-undefined-function/#findComment-100173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.