Skip to main content

How can I send html content?

Comments

6 comments

  • Eminds
    This question is actually irrespective of Cpanel, please try asking on other hosting forums and you may receive good guidelines on it.
    0
  • cPanelMichael
    Hello, Sending HTML content or attaching files to an email is possible. The method to do so depends on the email or webmail client you are using. Thank you.
    0
  • ortodata
    Thank You! I am using this code I get in cPanel's forum by: Send Email From PHP Using SMTP Authentication (Guide) [PHP]"; $to = "TargetName "; $subject = "Hi!"; $body = "Hi,\n\nHow are you?"; $host = "mail.mailserver.com"; $username = "name@myemail.com"; $password = "my_password"; $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("

    " . $mail->getMessage() . "

    "); } else { echo("

    Message successfully sent!

    "); } ?>[/PHP]
    0
  • cPanelMichael
    Hello, Here's a URL you may find helpful: Send HTML in email via PHP? Thank you.
    0
  • ortodata
    I can try, but no example has the line "require_once" Mail.php ";
    0
  • cPanelMichael
    Hello, Here's another URL you may find helpful: How to send an HTML email using SMTP in PHP Thank you.
    0

Please sign in to leave a comment.