hello friends i have one doubt i have use Php Mail function..and send message to my gmail account i have use to two code.code one only send to web mail not send to my gmail account..but second code it working and this same code..any one plz come me...
my php codes...
**Firscode**
<?php
if(isset($_POST['email']))
{
$name=$_POST['name'];
$email=$_POST['email'];
$phone=$_POST['mobile'];
$message=$_POST['message'];
$to='info@jeyamdecoration.com';
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
$headers .= 'From:
info@azasoft.com' . "\r\n" .'Reply-To:
info@azasoft.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion();
$mail_message='<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#cccccc">
<tr>
<td><table width="600" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" align="center">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#ED1B24">
<td width="61"><a href= "" target="_blank"><img src="" height="56" style="margin-left: 12px;" border="0" alt=""/></a></td>
<td width="393"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="46" align="right" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="67%"><font style="font-family: Lobster Two, cursive; color:#fff; font-size:8px; text-transform:uppercase"><a href= "#" style="color:#fff; text-decoration:none; font-family:Georgia, Times New Roman, Times, serif; font-size:16px;"><strong>Contact Form</strong></a></font></td><td width="4%"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10%"> </td>
<td width="80%" align="left" valign="top"><font style="font-family: Georgia, Times New Roman, Times, serif; color:#010101; font-size:24px"><strong><em>Welcome,</em></strong></font><br />
<br />
<font style="font-family: Verdana, Geneva, sans-serif; color:#666766; font-size:13px; line-height:21px">
The Following Person contact Jeyam Decoration<br /><br /></font>
</td>
<td width="10%"> </td>
</tr>
<tr>
<td colspan="3">
<table align="center" border="0" cellspacing="10" width="78%" style="background:#f7f7f7;margin-top:10px;border:1px solid #e8e8e8;border-radius:7px">
<tbody>
<tr>
<td width="62%" style="font-size:12px;font-family:Arial,Helvetica,sans-serif;color:#000;text-align:left;line-height:20px">Name: '.$name.'</a></td>
</tr>
<tr>
<td width="62%" style="font-size:12px;font-family:Arial,Helvetica,sans-serif;color:#000;text-align:left;line-height:20px">Email ID: '.$email.'</a></td>
</tr>
<tr>
<td width="62%" style="font-size:12px;font-family:Arial,Helvetica,sans-serif;color:#000;text-align:left;line-height:20px">Phone Number: '.$phone.'</a></td>
</tr>
<tr>
<td width="62%" style="font-size:12px;font-family:Arial,Helvetica,sans-serif;color:#000;text-align:left;line-height:20px"><font color="#000">Message: '.$message.'</font></a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="center"><font style="color:#000C99; font-size:10px; text-transform:uppercase"><strong>Thanks With Regards <br>Jeyam Decoration</strong></font></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
</tr>
<tr bgcolor="#f2f2f2">
<td> </td>
</tr>
</table></td>
</tr>
</table>';
$mail_send=mail($to, $email, $mail_message, $headers);
if(isset($mail_send))
{
echo "<script> alert('Thank you for submitting the form. We will contact you soon!');
window.location = 'contact.html'; </script>";
}
else{
echo "<script>
alert('sorry');
window.location = 'contact.html'; </script>";
}
echo '<script language="javascript">;
echo alert("come here");
echo </script>';
}
?> } ?>
**Second code**
<?php
if(isset($_POST['email']))
{
$name=$_POST['name'];
$email=$_POST['email'];
$mobile=$_POST['phone'];
$jobjitle=$_POST['job'];
$messag=$_POST['message'];
$to='ragu.azasoft@gmail.com,info@anss.co.in,manager@anss.co.in,
www.anss.co.in';
$from='info@azasoft.in';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: ABS Travels<'.$from.">\r\n".'Reply-To: '.$from."\r\n" .'X-Mailer: PHP/' . phpversion();
$message='<table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#f2f2f2">
<tr>
<td><table width="600" border="0" cellspacing="0" cellpadding="0" bgcolor="#FFFFFF" align="center">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#000">
<td width="61"><img src="http://www.anss.co.in/images/logo.png" height="56" style="margin-left: 12px;" border="0" alt=""/></a></td>
<td width="393"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="46" align="right" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="67%"><font style="font-family:Myriad Pro, Helvetica, Arial, sans-serif; color:#000C99; font-size:8px; text-transform:uppercase"><a href= "#" style="color:#fff; text-decoration:none; font-family:Georgia, Times New Roman, Times, serif; font-size:20px;"><strong></strong></a></font></td><td width="4%"> </td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center"> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="10%"> </td>
<td width="61"><a href= "" target="_blank"><img src="" height="56" style="margin-left: 12px;" border="0" alt=""/></a></td>
<td width="10%"> </td>
</tr>
<tr>
<td colspan="3">
<table align="center" border="0" cellspacing="10" width="78%" style="background:#f7f7f7;margin-top:10px;border:1px solid #e8e8e8;border-radius:7px">
<tbody>
<tr>
<td width="62%" style="font-size:12px;font-family:Arial,Helvetica,sans-serif;color:#000;text-align:left;line-height:20px">First Name: '.$name.'</a></td>
</tr>
<tr>
<td width="62%" style="font-size:12px;font-family:Arial,Helvetica,sans-serif;color:#000;text-align:left;line-height:20px">Email: '.$email.'</a></td>
</tr>
<tr>
<td width="62%" style="font-size:12px;font-family:Arial,Helvetica,sans-serif;color:#000;text-align:left;line-height:20px">Phone Number: '.$mobile.'</a></td>
</tr>
<tr>
<td width="62%" style="font-size:12px;font-family:Arial,Helvetica,sans-serif;color:#000;text-align:left;line-height:20px">Job Title : '.$jobjitle.'</a></td>
</tr><tr>
<td width="62%" style="font-size:12px;font-family:Arial,Helvetica,sans-serif;color:#000;text-align:left;line-height:20px"> Message: '.$messag.'</a></td></tr>
<tr>
</tr>
</tbody>
</table>
</td>
</tr>
</table></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="center"><font style="color:#000C99; font-size:10px; text-transform:uppercase"><strong>Thanks With Regards <br> Anns Crafters</strong></font></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="center"><font style="color:#231f20; font-size:11.5px"><strong></strong></font></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
</tr>
</table>';
$mail_send=mail($to, $email, $message, $headers);
if(isset($mail_send))
{
echo "<script> alert('Thank you for submitting the form. We will contact you soon!');
window.location = 'apply-online.html'; </script>";
}
else{
echo "<script>
alert('sorry');
window.location = 'apply-online.html'; </script>";
}
echo '<script language="javascript">;
echo alert("come here");
echo </script>';
}
?> } ?>