Page 1 of 1
Horrible Email HTML troubles
Posted: Wed Nov 02, 2005 10:54 pm
by blobman
Hello,
I have figured out how to email with html from a php script, although i am getting
X-NAS-Language: English X-NAS-Bayes: #0: 7.38197E-108; #1: 1 X-NAS-Classification: 0 X-NAS-MessageID: 71 X-NAS-Validation: {4122194F-EB3B-4CDD-8248-92C555CF49A9}
at the top of my email.
How do I get rid of that crap? I looked all over the internet, and all of the examples send this with the email.
Please help.
Thank you!
-Cameron
Posted: Wed Nov 02, 2005 11:02 pm
by feyd
Those are likely added by your server, and are out of your control.. but your headers passed to the mail function may have too many extra carriage returns in it... post your code.
Posted: Wed Nov 02, 2005 11:19 pm
by blobman
$headers .= "Content-Type: text/html\r\n";
was the header, along with some reply to stuff.
Then I pretty much had:
message = "
Sent from: $yourname <br> (at first I used \n, but then when using the html that wouldnt work)
Link: $link \<br>
etc etc etc"
I don't have the exact script anymore because I gave up and put it back to plain text, but I am having a lot of difficulty writing php emails. At first I had enough trouble using line skipts.
The only reason I went with html was to add some links in the actual email, because some email programs don't automatically make them links. If theres another way to do that, hit me up.
Posted: Thu Nov 03, 2005 7:12 pm
by blobman
So there is no fix then?
Posted: Thu Nov 03, 2005 7:15 pm
by Charles256
google phpmailer. install that.takes like 5 seconds and 7 seconds to figure out how to use. it overrides those headers sent by your host

Posted: Fri Nov 04, 2005 12:41 am
by blobman
Thanks Charles, I will check that out
Posted: Fri Nov 04, 2005 4:53 am
by jayshields
blobman, post your full code, you may have too many carriage returns after the reply to bit aswell...
remember to use php tags!
Posted: Fri Nov 04, 2005 5:51 pm
by blobman
feyd | Please use Code: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
X-NAS-Language: English X-NAS-Classification: 0 X-NAS-MessageID: 96 X-NAS-Validation: {4122194F-EB3B-4CDD-8248-92C555CF49A9}
Is what I get from a simple script i got off the internet similar to mine.
Code: Select all
<?php
$to = 'EMAIL';
$subject = 'Wakeup bob!';
$message = '<b>yo</b>, whassup?';
$headers = "From: admin@cameronperry.com\r\n" . "Content-Type: text/html\r\n";
// Send
mail($to, $subject, $message, $headers);
?>
Hmmm
feyd | Please use Code: Select all
tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Posted: Fri Nov 04, 2005 6:21 pm
by feyd
have you tried removing the last \r\n from your header variable?
Posted: Fri Nov 04, 2005 8:47 pm
by blobman
Wow, that worked
I though I had it withou the \r\n at one point
Well thank you very much for the assistance, this was driving me crazy.
Have a good weekend,
Cameron