Mailer scripts

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nitroxman
Forum Newbie
Posts: 8
Joined: Mon Mar 08, 2004 1:17 am

Mailer scripts

Post by nitroxman »

Now I've got my mailer script working, I'm wondering what makes the email come as a plain text style email?

I'm using plenty of html code and all the mails are showing html tags inside the email body.

I want the server to send a HTML email.

Something to do with the ISP's Webserver?

I'm guessing they're extra tags to put in the php file?
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

is your mail 'client/software' set up to accept HTML enabled e-mails?
nitroxman
Forum Newbie
Posts: 8
Joined: Mon Mar 08, 2004 1:17 am

Mailer script is send plain text email instead of html

Post by nitroxman »

Well at first I thought there was a wrong setting in Outlook that read all mails as plain text, so I sent it to a hotmail address, and got the same result. I've changed the setting to 'Use MS Word to read Rich Text mails'. No different.

Now I have no idea.
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

i dont use the mail() function so these are just stabs in the dark but

i believe you have to send 'headers' with the mail such as PNG blah blah just so it knows what its sending are you sending these?
nitroxman
Forum Newbie
Posts: 8
Joined: Mon Mar 08, 2004 1:17 am

Post by nitroxman »

Err no. This is the end part

Code: Select all

//This sends a confirmation to your visitor
mail($email, $theirSubject, $theirBody,"FROM:".$adminaddress);
	
echo "1"
?>
What sort of things tell it to be a html email?
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

There is a tutorial at http://www.sitepoint.com/article/advanced-email-php

also, you may want to have a look at http://phpmailer.sourceforge.net/
- a very nice mailing class with a straightforward and powerful API.
malcolmboston
DevNet Resident
Posts: 1826
Joined: Tue Nov 18, 2003 1:09 pm
Location: Middlesbrough, UK

Post by malcolmboston »

i have no idea, like i said i havent used this function as i mainly code on windows, not on my linux box and dont need the hassle of setting up a local mail server on it

theres some items about it
here


edit: lolololol same links :lol:
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

btw: you may want to set the content-type to "text/html", charset to "iso-8859-1" and encoding to "7bit" (see php manual mail function for details).
nitroxman
Forum Newbie
Posts: 8
Joined: Mon Mar 08, 2004 1:17 am

Thanks

Post by nitroxman »

Ok, cheers to all.

I'll have a look.

:P 8O 8O :P
Post Reply