-1

i have send one mail through php.In my browser is good to display. But in my gmail not good to display.i have attach my mail picture please help me.my mail image

function mail($to,$msgbody,$subject,$msgby,$content)
{
    $from = 'dass@world360.in'; 
    $headers = "MIME-Version: 1.0" . "\r\n";
    $headers .= $content." charset=iso-8859-1" . "\r\n";
    $headers .= "From: ".$from."\r\n";
    $headers .= "Reply-To: ".$msgby."\r\n";
    $returnPath = "-r".$from;
    if(mail($to, $subject, $msgbody, $headers, $returnPath))
    {
        return 1;
    }
    else
    {
        return 0;
    }
}
Dass Prakash
  • 152
  • 2
  • 13

1 Answers1

2

The space in the middle of 'kind' is probably because there's a line break in the middle of the word. The link doesn't work because of the line break in the href attribute. If you get rid of all the random line breaks, your html will probably work.

UPDATE:

I just thought I'd add this in case someone else is having the same issue: After some discussion with OP, he found out that most mail servers have a 990 character limit per line. If you don't properly format your code and have extremely long lines, the server could insert line breaks at that 990 char limit. I don't know if this is OP's issue without seeing the original message body, but it's a strong possibility. See: workaround for the 990 character limitation for email mailservers

Community
  • 1
  • 1
3ocene
  • 2,102
  • 1
  • 15
  • 30
  • @user2830034 there's a line break in the middle of the link's URL – 3ocene Dec 22 '15 at 17:22
  • If you get rid of all the random line breaks, everything will probably work fine... – 3ocene Dec 22 '15 at 17:23
  • As someone else said, you need to post the PHP for us to tell you what's wrong with it. – 3ocene Dec 23 '15 at 05:31
  • PHP doesn't insert random line breaks. You're doing something to cause it. Without seeing your code there's no way to tell what's causing the issue. – 3ocene Dec 23 '15 at 05:33
  • Edit your question and add it there. – 3ocene Dec 23 '15 at 05:36
  • But I can tell you that isn't where the problem is. Where does `$msgbody` come from? – 3ocene Dec 23 '15 at 05:38
  • Are you sure there's no line breaks? It doesn't make sense that they would just randomly appear. Can you show me how you're loading the body? – 3ocene Dec 23 '15 at 05:43
  • Maybe they aren't line breaks. Maybe they're just spaces. It's hard to tell when you just dump minified html and expect someone to fix it. – 3ocene Dec 23 '15 at 05:44
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/98764/discussion-between-user2830034-and-bern). – Dass Prakash Dec 23 '15 at 05:45
  • i think this one is formating problem now it's working thank you. – Dass Prakash Dec 23 '15 at 06:13