mail() custom format?

Reply

Join Date: Dec 2007
Posts: 609
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 8
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

mail() custom format?

 
0
  #1
Oct 17th, 2008
Anyone know how to get a custom layout when sending email's via mail()?

At the moment I would just like to start a new line in an email but eventually throw in images and etc.

Any information be much appericated.

Regards, X
"You never stop learning." - OmniX
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,073
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: mail() custom format?

 
1
  #2
Oct 17th, 2008
means , you want to write some thing in that mail...Right????
if so,
see this..
  1. $mail_body='<style type=text/css><!--td {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;}--></style>
  2. <table width="50%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#E7E7E7">
  3. <tr><td>[B]Do your design here...[/B]</td></tr>
  4. </table>';
  5.  
  6. mailto = 'some@some.com' ;
  7.  
  8. $mailheader = 'MIME-Version: 1.0' . "\r\n";
  9. $mailheader .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  10. $mailheader.=" From: someone\r\n";
  11. $mailheader .= 'BCc:some2@some.com' . "\r\n";
  12. @mail($mailto,' Details',$mail_body,$mailheader);
Last edited by Shanti Chepuru; Oct 17th, 2008 at 3:58 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 609
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 8
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

Re: mail() custom format?

 
0
  #3
Oct 17th, 2008
Ya using the mail function() http://www.php.net/mail.
Last edited by OmniX; Oct 17th, 2008 at 3:58 am.
"You never stop learning." - OmniX
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,073
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: mail() custom format?

 
0
  #4
Oct 17th, 2008
see my above edited post....
if something else you want...let do post..
Last edited by Shanti Chepuru; Oct 17th, 2008 at 4:00 am.
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 609
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 8
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

Re: mail() custom format?

 
0
  #5
Oct 17th, 2008
Hi shanti!

I have retired for the day and obligated over the weekend but I will try get it next week. Just for some confirmations:
  1. $mailheader = 'MIME-Version: 1.0' . "\r\n";
  2. $mailheader .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
These lines allow you to maniuplate the email into html? if not what purpose they serve?

[code=html]
$mail_body='<style type=text/css><!--td {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px;}--></style>
<table width="50%" border="0" align="center" cellpadding="1" cellspacing="0" bgcolor="#E7E7E7">
<tr><td>Do your design here...</td></tr>
</table>';
[code]
I put similar tags in my email and they just came out as normal <tr>, etc but I guess your decleration in the header will allow this to be formatted as html than rather text? This correct?

Thanks, Regards X
"You never stop learning." - OmniX
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,073
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: mail() custom format?

 
0
  #6
Oct 17th, 2008
yes,
To send HTML mail, the Content-type header must be set..
I guess your decleration in the header will allow this to be formatted as html than rather text? This correct?
right....

For more details see this
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 609
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 8
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

Re: mail() custom format?

 
0
  #7
Nov 4th, 2008
Thanks Shanti, works like a gem.

Now I just need something creative.

You have any idea on how to send images along with the email?

would be a simply img refer to an image on the server?

Also any other fancy ideas you have will be much appericated.

Thanks, Regards X
Last edited by OmniX; Nov 4th, 2008 at 10:17 pm.
"You never stop learning." - OmniX
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 1,073
Reputation: Shanti Chepuru is on a distinguished road 
Solved Threads: 98
Shanti Chepuru's Avatar
Shanti Chepuru Shanti Chepuru is offline Offline
Veteran Poster

Re: mail() custom format?

 
1
  #8
Nov 4th, 2008
i generally used img tag to send images through my mail function...it gives me no error at all....if you know any other fancy ideas,post here for all daniweb members..

thanks omnix
Be intelligent, But Don't try to cheat.. Be innocent But Don't get cheated..
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 609
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 8
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

Re: mail() custom format?

 
0
  #9
Nov 5th, 2008
As I get them I will.

My basic aim is to re-create a webpage in an email, with all images, etc.

How did you post the image?

I tried the <img src="server"> and it didnt work came up as an X (not loaded).

If I get any cool ideas ill let you know but objective is to basically recreate a small webpage in the email (that would be cool).

Thanks, Regards X
"You never stop learning." - OmniX
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 609
Reputation: OmniX is an unknown quantity at this point 
Solved Threads: 8
OmniX's Avatar
OmniX OmniX is offline Offline
Practically a Master Poster

Re: mail() custom format?

 
0
  #10
Nov 13th, 2008
help with the <img> tag please? Thanks
"You never stop learning." - OmniX
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC