Web Hosting
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2012

    Question HTML Email Problem

    I recently started working on a page that will allow users to send emails inviting their friends to the website. I was bored of the plain text emails, so I decided to go with HTML emails. I managed to get the emails to send to my own email address, but no other addresses could receive the email.

    I am using: mail(to, subject, body, header)

    My header consists of:
    $header = "From: <-Email Goes Here->
    MIME-Version: 1.0
    Content-type: text/html; charset=ISO-8859-1";

    I was wondering if anyone might know what the problem is.

    The email DOES send to any email address hosted on my website, but does not work for any other email address, nor does it work when forwarding through my website.
    My website is hosted by Siteground, so I'm wondering if there is any possible mail configuration that might be blocking the emails.

    If you know what may be going on, all help is greatly appreciated.

    - Austin

  2. #2
    Join Date
    Apr 2012


    After a few minutes of thinking, I think I figured out how to fix this (sort of). I haven't looked at PEAR mail much, but I'm guessing that that may be the answer to solving this problem. I'll try it out and see if I still have any problems.

  3. #3
    Join Date
    Apr 2012

    Default Fixed

    To answer my own question, yes, PEAR mail fixed the problem.

    If anyone is experiencing something similar, or simply wants to do the same, here the code I used.

    __________ Code __________

    $to = "_____________"; // Address to send to
    $subject = "_______________"; // Subject of email
    $from = "______________"; // Sender name/address

    $body = "______________"; // HTML version of body
    $textbody = "____________"; // Text version of body

    $host = "________________"; // Email Host
    $username = "___________"; // Email Username
    $password = "___________"; // Email Password

    $headers = array ('From' => $from,
    'To' => $to,
    'Subject' => $subject);
    $smtp = Mail::factory('smtp',
    array ('host' => $host,
    'auth' => true,
    'username' => $username,
    'password' => $password));

    $mime = new Mail_mime(array('eol' => $crlf));


    $body = $mime->get();
    $headers = $mime->headers($headers);

    $mail = $smtp->send($to, $headers, $body);

    __________ Code END __________

    Hopefully this will end up helping someone.

    - Austin

  4. #4


    do like this

    <p><font... face="Arial"><........strong>Contact by E-mail</..........strong></......font></p>
    <p><a href="mailto:xxxxxxxxx@gmail.com"><font face="Arial"

Similar Threads

  1. How to embed image in html email?
    By imdavidlee in forum Hosting Related Questions
    Replies: 4
    Last Post: 05-31-2011, 12:43 AM
  2. HTML tags stripped out of email body
    By nwwds in forum Hosting Related Questions
    Replies: 1
    Last Post: 02-28-2010, 05:54 AM
  3. Really simple question: email in html page
    By timshel in forum Hosting Related Questions
    Replies: 1
    Last Post: 05-14-2008, 11:40 AM
  4. html/php strange problem
    By mcdowalr in forum General Joomla Discussions
    Replies: 2
    Last Post: 12-11-2007, 02:10 AM
  5. problem viewing Flash movie in html
    By phoenix5 in forum Other Software and Applications
    Replies: 2
    Last Post: 02-12-2007, 02:57 AM

Posting Permissions

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