Jump to content

phpmailer - undefined function


trillion

Recommended Posts

I am trying the tutorial here: http://www.phpfreaks.com/tutorials/130/0.php
to 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 21

the 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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.