SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Mar 2011
    Location
    Manchester, UK
    Posts
    226
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sending HTML Email Help

    Hi Guys,

    I know how to send HTML emails using PHP but the problem I'm having is the HTML code is breaking my code and just wondering what the best way of doing this is?

    PHP Code:
    /*Send Email To New Affiliate*/
    $to $email;
    $message "HTML CODE GOES HERE";

    $from "magazines@xxx.com";

    $headers "MIME-Version: 1.0" "\r\n";
    $headers .= "Content-type:text/html;charset=iso-8859-1" "\r\n";
    $headers .= 'From: <mike@xxx.com>' "\r\n";
     
    mail($to,$subject,$message,$headers); 
    Any help would be great.

    Thank you!
    You're Help Does Not Go Unnoticed, I have So Far Donated 25 GBP
    To Cancer Research UK As A Thank You To All The SitePoint
    Members That Have Helped Me In The PHP Forum Thank You!

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Where is $subject coming from?

    What do you mean "breaking my code", what errors are you seeing?

  3. #3
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I guess 'breaking' means you have got the non-formatted HTML codes in your email and I suspect that because of new line character treated by different servers so try with only '\n' instead of '\r\n'.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •