By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,216 Members | 1,032 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,216 IT Pros & Developers. It's quick & easy.

Mail sending problem

AMT India
P: 64
I am sending mail using the below code]

Expand|Select|Wrap|Line Numbers
  1.  $to = "rosh@yahoo.com";
  2.             $subject = "test mail";
  3.             $headers = "MIME-Version: 1.0\r\n";
  4.             $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
  5.             $headers .= "From:<rosh@gmail.com>";
  6.             $mail_sent = mail($to,$subject ,$msg,$headers);
  7.  
  8.             if($mail_sent)
  9.                 return true;
  10.             else
  11.                 return false;
  12.  
but the mai getting only the html tag form
Expand|Select|Wrap|Line Numbers
  1. Content-type: text/html; charset=ISO-8859-1
  2.  
  3. From:<rosh@gmail.com>
  4. Message-Id: <20080201170833.45F931AF0065@server8142.mivitec.net>
  5. Date: Fri,  1 Feb 2008 18:08:33 +0100 (CET)
  6.  
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml">
  9. <head>
  10. <title>@@weblog</title>
  11. <meta http-equiv=content-type content="text/html; charset=ISO-8859-1" />
  12. </head>
  13.  
  14.  
  15.  
  16. <body bgcolor="#FFFFFF" topmargin="0" leftmargin="0">
  17.  
  18.  
  19.  
  20.  <table width="800px" cellpadding="0" cellspacing="0">
  21.  
  22.  <tr><td colspan="2"><a href="http://www.liebeundgesundheit.de/"
  23. target="_blank"><img
  24. src="http://www.liebeundgesundheit.de//img/head-lug-ora.jpg" border="0"
  25. /></a></td></tr>
  26.  
  27.  <tr>
  28.  
  29.   <td width="169px" bgcolor="#E0E0E0"></td>
  30.  
  31.   <td width="637px" style="PADDING:5px; TEXT-ALIGN:right;"><p
  32. style="FONT:12px Arial, Helvetica, sans-serif;">M&ouml;rfelden-Walldorf, den
  33. 01-02-2008</p></td>
  34.  
  35.  </tr>
  36.  
  37.  <tr>
  38.  
  39.   <td width="170px" bgcolor="#E0E0E0"></td>
  40.  
  41.   <td width="637px" style="PADDING:10px;">
  42.  
  43.    <p style="FONT:bold 16px Arial, Helvetica, sans-serif;">Ihre Anmeldung
  44. zum Newsletter von <span
  45. style="COLOR:#FF6633;">liebeundgesundheit.de</span></p>
  46.  
  47.    <p style="FONT:13px Arial, Helvetica, sans-serif;">Sehr geehrte Herru Jan
  48. Krause,</p>
  49.  
  50.    <p style='FONT:13px Arial, Helvetica, sans-serif;'>vielen Dank f&uuml;r
  51. Ihre Anmeldung zum Newsletter von <span
  52. style='COLOR:#FF6633;'><b>liebe</b>und<b>gesundheit</b>.de</span>. Somit
  53. bleiben Sie immer auf dem Laufenden &uuml;ber neue Artikel, neue Fragen und
  54. Antworten und &uuml;ber spezielle Events.</p><p style='FONT:13px Arial,
  55. Helvetica, sans-serif;'>  Um Ihre Anmeldung zum Newsletter
  56. abzuschlie&szlig;en, klicken Sie bitte unten auf den Link, oder kopieren
  57. diesen in die URL-Zeile Ihres Browsers:<br /><a
  58. href=http://www.liebeundgesundheit.de/newsletter.html?action=subscribe&email
  59. =jvk@vinico.com&id=a87ff679a2f3e71d9181a67b7542122c
  60. > >http://www.liebeundgesundheit.de/newsletter.html?action=subscribe&email=jvk
  61. @vinico.com&id=a87ff679a2f3e71d9181a67b7542122c</a></p>
  62.  
  63.    <p style="FONT:13px Arial, Helvetica, sans-serif;">Herzlichst,<br />Ihr
  64. liebeundgesundheit.de-Team</p>
  65.  
  66.   </td>
  67.  
  68.  </tr>
  69.  
  70. </table>
  71.  
  72. <table width="800px" cellpadding="10px" cellspacing="0">
  73.  
  74.  <tr>
  75.  
  76.   <td valign="top"><p style="FONT:12px Arial, Helvetica, sans-serif;
  77. COLOR:#555555;">Silberlust GmbH<br />Gesch&auml;ftsf&uuml;hrer: Martin
  78. Kessel<br />Kelsterbacher Str. 28<br />64546 M&ouml;rfelden-Walldorf<br
  79. />Germany</p></td>
  80.  
  81.   <td valign="top"><p style="FONT:12px Arial, Helvetica, sans-serif;
  82. COLOR:#555555;">Tel: 06105 203720<br />Fax: 06105 455901<br />email: <a
  83. href="mailto:info@liebeundgesundheit.de">info@liebeundgesundheit.de</a><br
  84. />site: www.liebeundgesundheit.de</p></td>
  85.  
  86.   <td valign="top"><p style="FONT:12px Arial, Helvetica, sans-serif;
  87. COLOR:#555555;">Handelsregister Darmstadt HRB 54267<br />Ust-ID:
  88. DE812260688<br />Steuer-Nr: 00723724776</p></td>
  89.  
  90.  </tr>
  91.  
  92. </table>
  93.  
  94. </body>
  95.  
  96. </html>
  97.  

Regards,
AMT
Feb 7 '08 #1
Share this Question
Share on Google+
5 Replies


rizwan6feb
100+
P: 108
What are you sending in the message? There can be problem with the HTML
Feb 7 '08 #2

AMT India
P: 64
messge in html format
Feb 7 '08 #3

George Lft
P: 26
you didn't include <?php, dude.

i would not use that script, look for a different one. the mail() function should only be included after all the( php if else , etc. )
Feb 8 '08 #4

nomad
Expert 100+
P: 664
I am sending mail using the below code]

Expand|Select|Wrap|Line Numbers
  1. $to = "rosh@yahoo.com";
  2. $subject = "test mail";
  3. $headers = "MIME-Version: 1.0\r\n";
  4. $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
  5. $headers .= "From:<rosh@gmail.com>";
  6. $mail_sent = mail($to,$subject ,$msg,$headers);
  7.  
  8. if($mail_sent)
  9. return true;
  10. else
  11. return false;
  12.  
but the mai getting only the html tag form
Expand|Select|Wrap|Line Numbers
  1. Content-type: text/html; charset=ISO-8859-1
  2.  
  3. From:<rosh@gmail.com>
  4. Message-Id: <20080201170833.45F931AF0065@server8142.mivitec.net>
  5. Date: Fri, 1 Feb 2008 18:08:33 +0100 (CET)
  6.  
  7. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  8. <html xmlns="http://www.w3.org/1999/xhtml">
  9. <head>
  10. <title>@@weblog</title>
  11. <meta http-equiv=content-type content="text/html; charset=ISO-8859-1" />
  12. </head>
  13.  
  14.  
  15.  
  16. <body bgcolor="#FFFFFF" topmargin="0" leftmargin="0">
  17.  
  18.  
  19.  
  20. <table width="800px" cellpadding="0" cellspacing="0">
  21.  
  22. <tr><td colspan="2"><a href="http://www.liebeundgesundheit.de/"
  23. target="_blank"><img
  24. src="http://www.liebeundgesundheit.de//img/head-lug-ora.jpg" border="0"
  25. /></a></td></tr>
  26.  
  27. <tr>
  28.  
  29. <td width="169px" bgcolor="#E0E0E0"></td>
  30.  
  31. <td width="637px" style="PADDING:5px; TEXT-ALIGN:right;"><p
  32. style="FONT:12px Arial, Helvetica, sans-serif;">M&ouml;rfelden-Walldorf, den
  33. 01-02-2008</p></td>
  34.  
  35. </tr>
  36.  
  37. <tr>
  38.  
  39. <td width="170px" bgcolor="#E0E0E0"></td>
  40.  
  41. <td width="637px" style="PADDING:10px;">
  42.  
  43. <p style="FONT:bold 16px Arial, Helvetica, sans-serif;">Ihre Anmeldung
  44. zum Newsletter von <span
  45. style="COLOR:#FF6633;">liebeundgesundheit.de</span></p>
  46.  
  47. <p style="FONT:13px Arial, Helvetica, sans-serif;">Sehr geehrte Herru Jan
  48. Krause,</p>
  49.  
  50. <p style='FONT:13px Arial, Helvetica, sans-serif;'>vielen Dank f&uuml;r
  51. Ihre Anmeldung zum Newsletter von <span
  52. style='COLOR:#FF6633;'><b>liebe</b>und<b>gesundheit</b>.de</span>. Somit
  53. bleiben Sie immer auf dem Laufenden &uuml;ber neue Artikel, neue Fragen und
  54. Antworten und &uuml;ber spezielle Events.</p><p style='FONT:13px Arial,
  55. Helvetica, sans-serif;'> Um Ihre Anmeldung zum Newsletter
  56. abzuschlie&szlig;en, klicken Sie bitte unten auf den Link, oder kopieren
  57. diesen in die URL-Zeile Ihres Browsers:<br /><a
  58. href=http://www.liebeundgesundheit.de/newsletter.html?action=subscribe&email
  59. =jvk@vinico.com&id=a87ff679a2f3e71d9181a67b7542122c
  60. > >http://www.liebeundgesundheit.de/newsletter.html?action=subscribe&email=jvk
  61. @vinico.com&id=a87ff679a2f3e71d9181a67b7542122c</a></p>
  62.  
  63. <p style="FONT:13px Arial, Helvetica, sans-serif;">Herzlichst,<br />Ihr
  64. liebeundgesundheit.de-Team</p>
  65.  
  66. </td>
  67.  
  68. </tr>
  69.  
  70. </table>
  71.  
  72. <table width="800px" cellpadding="10px" cellspacing="0">
  73.  
  74. <tr>
  75.  
  76. <td valign="top"><p style="FONT:12px Arial, Helvetica, sans-serif;
  77. COLOR:#555555;">Silberlust GmbH<br />Gesch&auml;ftsf&uuml;hrer: Martin
  78. Kessel<br />Kelsterbacher Str. 28<br />64546 M&ouml;rfelden-Walldorf<br
  79. />Germany</p></td>
  80.  
  81. <td valign="top"><p style="FONT:12px Arial, Helvetica, sans-serif;
  82. COLOR:#555555;">Tel: 06105 203720<br />Fax: 06105 455901<br />email: <a
  83. href="mailto:info@liebeundgesundheit.de">info@liebeundgesundheit.de</a><br
  84. />site: www.liebeundgesundheit.de</p></td>
  85.  
  86. <td valign="top"><p style="FONT:12px Arial, Helvetica, sans-serif;
  87. COLOR:#555555;">Handelsregister Darmstadt HRB 54267<br />Ust-ID:
  88. DE812260688<br />Steuer-Nr: 00723724776</p></td>
  89.  
  90. </tr>
  91.  
  92. </table>
  93.  
  94. </body>
  95.  
  96. </html>
  97.  

Regards,
AMT

try doing this instead
$EmailTo = emailname@here.com;



nomad
Feb 8 '08 #5

nomad
Expert 100+
P: 664
Lets try this again
Try doing this
$EmailTo = "yourname@ldomainname.com";

not $to = "yourname@ldomainname.com";

nomad
Feb 8 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.