Jump to content

aliging problems in email


php_begins

Recommended Posts

Hi, I need to send a html image as an email to people. Here is the link http://cs.txstate.edu/~sr1388/Test/..

When I send I send the email by copying the source code(from view source) of that page, everything looks the same except for the fact the registry and review tables dont get aligned side by side . I cannot find what issue is causing it.

This is what my email function looks like:

<?
$content='view-source code here';
echo $content;
$to = "me@gmail.com";
$subject = "test";
$body=$content;
//$body="hello";
//$message=$total;

$from = "webmaster@example.com";
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
//$headers .= 'X-Mailer: PHP/' . phpversion() . "\r\n";
$headers .= 'From: Admin <Admin@mysite.com>' . "\r\n";


// Send email
if(mail($to,$subject,$body,$headers))
{
// Inform the user
  echo "Your email has been sent";
}
else
{
  echo "MAIL not sent";
}
?>

Link to comment
Share on other sites

This has nothing to do with the sending of the email. The issue is, email clients do not render HTML the same as they do in a browser.

Sadly, you will have to create an "email friendly" version of your HTML code.

 

People think cross-browser compatibility is a pain, with emails its even worse.

Link to comment
Share on other sites

As I said each email client renders things differently.

gmail, hotmail, outlook, thunderbird, windows live mail etc etc have the potential to display emails differently.

Even more so with the popularity of smart phones, life in the email design world just got that little more complicated.

 

There is no (that I know of) definitive way to test for email compatibility, my best advice would be to keep the layout as simple as possible, use as little CSS as you can (paddings and margins arent worth anything really in an email).. and (I never thought I would say this) tables are your friend.

Link to comment
Share on other sites

Research, build, test  . . repeat

 

Do some searching and you will find some resources on the web. Build some test email and check what they look like in various email clients. If you want the email to look "exactly" right your only option will be to create the email out of images. If you have "advanced" styles in the email you are goingto be struggling to get it to look right in various email clients (especially web-based ones). I'd suggest going with a clean, simple design.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.