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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.