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->
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.
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.
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.
do like this
<p><font... face="Arial"><........strong>Contact by E-mail</..........strong></......font></p>
<p><a href="mailto:firstname.lastname@example.org"><font face="Arial"
By imdavidlee in forum Hosting Related Questions
Last Post: 05-31-2011, 01:43 AM
By nwwds in forum Hosting Related Questions
Last Post: 02-28-2010, 06:54 AM
By timshel in forum Hosting Related Questions
Last Post: 05-14-2008, 12:40 PM
By mcdowalr in forum General Joomla Discussions
Last Post: 12-11-2007, 03:10 AM
By phoenix5 in forum Other Software and Applications
Last Post: 02-12-2007, 03:57 AM
Copyright © 2012 SiteGround.com Inc