php mail delay

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
YoussefSiblini
Forum Contributor
Posts: 206
Joined: Thu Jul 21, 2011 1:51 pm

php mail delay

Post by YoussefSiblini »

Hi I am not sure why my php mail function is delaying 30 minute to send the email:
When I receive the email the from section come weird like this:

From: areebanc@srv33.hosting24.com on behalf of Areeban.com (admin@areeban.com)
Hosting24 is my hosting company and areeban.com is my website.

here is my code:

Code: Select all

// send email to the Existing swapper
	    $headers = "MIME-Version: 1.0\n";
            $headers .= "Content-type: text/html; charset=iso-8859-1\n";
            $headers .= "From: Areeban.com <info@areeban.com>\n";
            $headers .= "X-Mailer: PHP's mail() Function\n";
            $swappermessage =
			'
			    <img src="http://www.areeban.com/images/logo.png"/><br/>
			    <strong>This is an email from areeban.com</strong><br/>
			    The user ' . $User_name . ' offered you a deal to make a swap with one of your swaps, here is the details:<br/><br/>
				
				<h3 style="margin-bottom:20px">Your Swap details</h3>
				<table width="100%" style="border-collapse:collapse; border:1px #cfffc6 solid">
                      <tr>
                         <th style="width:28%; background:#86FF6F; text-align: left; padding:5px">Swap Title</th>
                         <th style="width:35%; background:#86FF6F; text-align: left; padding:5px">Swap with Title</th>
                         <th style="width:15%; background:#86FF6F; text-align: left; padding:5px">Location</th>
                         <th style="width:10%; background:#86FF6F; text-align: left; padding:5px ">City</th>
                         <th style="width:12%; background:#86FF6F; text-align: left; padding:5px">Date Added</th>
                      </tr>
                      <tr>
                         <td style="vertical-align: top; padding:5px">' . $Eproducttittle . '</td>
                         <td style="vertical-align: top; padding:5px">' . $EExchangeWithTittle . '</td>
						 <td style="vertical-align: top; padding:5px">' . $Eswaptakeplace . '</td>
                         <td style="vertical-align: top; padding:5px">' . $Ecity . '</td>
                         <td style="vertical-align: top; padding:5px">' . $Edateadded . '</td>
                      </tr>
				</table>
				<br/><br/>
				<h3 style="margin-bottom:20px">Swapper details</h3>
				<table width="100%" style="border-collapse:collapse; border:1px #cfffc6 solid">
                      <tr>
                         <th style="width:28%; background:#86FF6F; text-align: left; padding:5px">Swap Title</th>
                         <th style="width:35%; background:#86FF6F; text-align: left; padding:5px">Swap Description</th>
                         <th style="width:15%; background:#86FF6F; text-align: left; padding:5px">Swap with Title</th>
                         <th style="width:10%; background:#86FF6F; text-align: left; padding:5px ">City</th>
                         <th style="width:12%; background:#86FF6F; text-align: left; padding:5px">Date Added</th>
                      </tr>
                      <tr>
                         <td style="vertical-align: top; padding:5px">' . $producttittle . '</td>
						 <td style="vertical-align: top; padding:5px">' . $productdescription . '</td>
                         <td style="vertical-align: top; padding:5px">' . $ExchangeWithTittle . '</td>
                         <td style="vertical-align: top; padding:5px">' . $city . '</td>
                         <td style="vertical-align: top; padding:5px">' . $dateadded . '</td>
                      </tr>
				</table>
			
			    <strong>
				    <a href="http://www.areeban.com/accept.php?existingSwapTrackID=' . $existingSwapTrackID . '&existingSwapTable=' . $existingSwapTable . '&existingSwapDatabase=' . $existingSwapDatabase . '&makingSwapTrackID=' . $makingSwapTrackID . '&makingSwapDataBase=' . $makingSwapDataBase . '&makingSwapTable=' . $makingSwapTable . '">ACCEPT</a> 
					<a href="http://www.areeban.com/decline.php?existingSwapTrackID=' . $existingSwapTrackID . '&existingSwapTable=' . $existingSwapTable . '&existingSwapDatabase=' . $existingSwapDatabase . '&makingSwapTrackID=' . $makingSwapTrackID . '&makingSwapDataBase=' . $makingSwapDataBase . '&makingSwapTable=' . $makingSwapTable . '">DECLINE</a> 
					<a href="http://www.areeban.com/replydeal.php?existingSwapTrackID=' . $existingSwapTrackID . '&existingSwapTable=' . $existingSwapTable . '&existingSwapDatabase=' . $existingSwapDatabase . '&makingSwapTrackID=' . $makingSwapTrackID . '&makingSwapDataBase=' . $makingSwapDataBase . '&makingSwapTable=' . $makingSwapTable . '">SEND MESSAGE</a>
					</strong><br/><br/>
				
			    areeban.com team<br/><br/>
			    Good Luck Hope you have fun
			
			
            '; 
            mail($Eemail, "Swapper Deal Regarding your Swap", $swappermessage ,$headers);
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: php mail delay

Post by Christopher »

You should probably contact you hosting company's tech support to find out how to send email with PHP.
(#10850)
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: php mail delay

Post by Eric! »

If you're sending it from your domain to your own email address at the same domain it should be almost instant. If you are sending the email to some other address like hotmail or gmail then sometimes it takes a magical amount of time for it to arrive.
Post Reply