PHP E-Mail Codes

Discussion in 'PHP' started by MichaelLewis, Mar 4, 2009.

  1. #1
    I'm sending e-mails from my php code.
    What are the codes or where can I find the codes to set the my e-mail text to Bold or to a Red color or a larger font, etc.
    The only code I know is backslah n for Chariage Return Line Feed.
    Thank you,
    Michael
     
    MichaelLewis, Mar 4, 2009 IP
  2. mbaldwin

    mbaldwin Active Member

    Messages:
    215
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    95
    #2
    So you want to send html e-mails?
    How are you sending them with your php code?
     
    mbaldwin, Mar 4, 2009 IP
  3. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Set Content-Type to text/html and then just use HTML tags.

    Or, for broader compatibility, use multipart/alternative with text/html and text/plain MIME sections.
     
    SmallPotatoes, Mar 4, 2009 IP
  4. DGK

    DGK Peon

    Messages:
    73
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Yes that's the way!
    use HTML like
    <strong>Some title</strong><br />
    <span style="color:#ff0000; font-weight:bold;">some text</span>
     
    DGK, Mar 5, 2009 IP
  5. crivion

    crivion Notable Member

    Messages:
    1,669
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    210
    Digital Goods:
    3
    #5
    I recommend you to go to a html tutorials site like on w3c and see every html tag needed then add headers into mail function to let interpretors to know that the mails are html
    thats all
     
    crivion, Mar 5, 2009 IP
  6. MichaelLewis

    MichaelLewis Active Member

    Messages:
    36
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    93
    #6
    By using the following code:
    mail($To,$Subject,$Body,$Header)
    Michael
     
    MichaelLewis, Mar 5, 2009 IP
  7. abada

    abada Member

    Messages:
    5
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #7
    use this class phpmailer.codeworxtech.com/index.php?pg=examples

    it`s very useful

    Good Luck...
     
    abada, Mar 6, 2009 IP