473,385 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Body/Subject/Headers Mix-up

I'm an experienced PHP user, but am having a nightmare with one aspect
of PHPMailer. Can't find anyone else posting with the same problem on
any of the usual forums, so if anyone can help me, I'd be grateful.
Here goes:
Trying to post with PHP mailer. Here's the script:

$mail = new PHPMailer();
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = "localhost"; // SMTP server
$mail->FromName = "Whatever";
$mail->From = "wh******@whatever.com";
$mail->Subject = 'this is the subject';
$mail->Body = 'this is the body\n\n this is the 2nd line of the body';
$mail->AddAddress('w***@ever.com')
$mail->Send();

The script sends ok, but what I get at the other end is this (I've
added the <> bits for clarity):

<subject>
this is the body
</subject>

<body>
this is the 2nd line of the body.

Message-ID: <lo******************@whatever.com>

X-Priority: 3
X-Mailer: PHPMailer [version 1.70]
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset="iso-8859-1"

this is the body

this is the 2nd line of the body.
</body>

So for some reason, it's adding header tags to the BEGINNING (I think)
of the body.

Any thoughts, anyone ?

Terry

Oct 18 '05 #1
0 1251

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: Chuck Amadi | last post by:
Sorry to bovver you again (again) here's script. I still can't see why the get_payload() doesn't produce the plain text message body of an emails in the testwwws users mailbox. As you can see I...
0
by: chuck amadi | last post by:
Hi I have managed to print the output of the get_payload to screen but I need to write to a file as I only require the email body messages from the mailbox.My script using the fp.readlines()...
6
by: andrew blah | last post by:
Hello, I need to get the text of the body (the payload) of an email. As I understand it, an email has headers at the top, then a blank line, then the body of the message. I want to get the...
7
by: Mario Leduc | last post by:
Hi, I have a page that sends user comments with CDONTS, works fine. Until I put a URL (http://192.168.0.1). If I use http://domain.com it works fine. Why with the numeric URL, CDONTS does not...
5
by: Ney André de Mello Zunino | last post by:
Hello. Running the following document through the W3C's validator, returns the error: "end tag for "body" which is not finished." <!-- Start of sample document --> <?xml version="1.0"...
1
by: Andre | last post by:
Hi folks, I'm trying to create a sub that e-mails the results of program output to our accounts receivable manager. I built my CDO code using examples from a couple newsgroups like this one, so...
2
by: xyz | last post by:
Hello, I would like to send an email to my web site and have it display the subject and message on my webpage. Any help would be appreciated. My site is uses SMTP mail. Thanks!
1
by: techjohnny | last post by:
Here is the code I'm using: <?php include('Mail.php'); $recipients = array('To' ='sanfranc415@yahoo.com', ); $headers = 'techjohnny@gmail.com';
1
by: Chuck W1CEW | last post by:
So, I don't quite get how to solve this. See code example below. The basic problem is that emails that my form-to-mails generate using the mail() function consistently put in two CR/LF's for...
2
by: urbanedge | last post by:
I've just acquired a site and uploaded to godaddy and the email function won't work. I'm new to php and I'm not able to determine where the issue is. I've commented out $this->header .=...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.