Edit a php file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • sara2006
    Forum Member
    • Apr 2006
    • 32

    Edit a php file

    Hi guys
    i use a php to send my emails but i have a question can i set the font color, size and alignment for body and then send the mail and reseve it with the new setting (new color, size, alignment, etc)?
    i wonder if would you guid me to set these settings in php?
    thanks alot and sorry for my bad english
  • coderanger
    Forum Member
    • Jan 2007
    • 56

    #2
    Hi Sara,

    Are you saying you want to format your email for HTML instead of plain text?

    There are many options available, but I would personally use plain text for
    your emails. I've had a lot of experience with email and php, and I can tell
    you that most people do not use html for their email readers.

    Anyway, here are a few options you might be able to use:

    PHP Code:
    //Use the following to replace anything plain text to html:
    $email_body "Your Email Message Here..\t\nThis starts a new line in plain text emails.";
    $email_body str_replace("\t\n""<br>"$email_body);

    //The above will reformat any lines found with newline character(s) to the
    //html version of <br>. You could actually replace anything you like this way.

    //To handle the font size you're asking about, you could do this:
    $email_body "<font face='verdana' size='2'>Your Email Message Here</font>";

    //Send the email
    mail($to$subject$email_body$headers); 
    I hope this answers your question, if not let me know and I'll try to help
    further.

    Patrick

    Comment

    • sara2006
      Forum Member
      • Apr 2006
      • 32

      #3
      Thanks

      thanks for your help and your advise :yes :yes :yes
      but i have another question, can i send an attachment with a php or i need to use other programs or dll?
      thanks agian

      Comment

      • RizlaUK
        Indigo Rose Customer
        • May 2006
        • 5478

        #4
        i dont know about php, but Dermots xSMTP dll can sent attachments and its real easy to use, but of course, you need to buy xDialog to get it
        Embrace change in your life, you never know, it could all work out for the best

        Comment

        • coderanger
          Forum Member
          • Jan 2007
          • 56

          #5
          Hi Sara,

          Yes, you can send attachments via php mail, it's all in the
          MIME encoding that you use.

          I would like to suggest a free php email class that I and many
          commercial companies use for dealing with emails using php
          that has all of the bells and whistles already added... It's called
          PHPMailer, and it's open source and free to use in your programs.

          You can find it here: http://phpmailer.sourceforge.net/

          I recently used the latest version in a php membership script I
          created, and it is very easy to use and can save you many hours
          of cutting through code trying to find just the right options you
          need, it has them all built-in. You can even set it up to send
          mail via SMTP!

          If you need any help, please pm me and I will help with what I can.

          Patrick

          Comment

          Working...
          X