[RESOLVED] Mail() function, taking time to load a page.
Hi All,
I'm working on a project, where I need to send mail to a customer, if
1)customer registser to the site.
2)customer places an order.
I have used Mail() function. but it's taking too much time to load a page..
if I comment Mail(). page is getting executed fast.
Is there any solution, so dat using Mail() page load time can b reduced..
below is the code for registration
//
<? $sndUrl = "http://".$_SERVER['HTTP_HOST']."/main/redirect.php?r=reg&u=$usrEmail";
$emlMesg="
<font style='font-size:11px;font-family:georgia'>
Welcome to <B>abc.com</b>!<BR><br>
Thank you for registering with shippingsearch.com.<BR>
Please click the link below to continue your registration:<BR>
<a href='$sndUrl'>$sndUrl</a> <BR><BR>
If the above link does not work please copy the link below and paste or type it into
your browser/navigator address window.<BR><BR>
The e-mail address that you have registered is <a href='mailto:$usrEmail'>$usrEmail</a>.<BR><BR>
If you have any problems with this registration process please e-mail your queries
to <a href='mailto:[email protected]'>[email protected]</a>.
We will complete your registration for you.<BR><BR>
Sincere regards,<BR>
Support Division<BR>
?>
<?
$sendto = $usrEmail;
$ccto = "[email protected]";
$frmEml = "[email protected]";
$headers = "From: $frmEml\r\nCC:$ccto\r\nContent-type: text/html;charset=us-ascii";
$subject = "Your Registration at abc.com";
mail($sendto, $subject, $emlMesg, $headers);
?>
//
same code is for orders but with the order details..
Please it's urgent
Veena
Re: [NOT RESOLVED] Mail() function, taking time to load a page.
Are you running this script on windows or linux? It's worth remembering that if you have configured PHP to use an SMTP server, a hanging connection will cause the script to hang indefinitely.
The only way around this is not to use the mail function. Instead store all the emails you with to send in a temporary directory and have script run as a cron job at regular intervals to send the email.