Solved

Why does php mail() take 30 seconds to run on my VPS?

Posted on 2011-02-16
1
334 Views
Last Modified: 2012-05-11
I was running a website on a shared hosting account.  Part of this website involved sending a lot of messages via PHP mail().  Unfortunately, all shared hosting providers I could find had a cap on how many emails could be sent per hour.

So, I decided to get a VPS.  I am cheap, so I thought I would get an unmanaged one with cpanel.  Everything is fine and dandy, I have everything up and running.  The only problem I have, is that every message sent by php mail takes about 30 seconds to send.  The same thing happens when I send via the PEAR SMTP package.  Takes about 30 seconds, and sends three times.

It could be a DNS issue, I had no idea how to set it up, so I guessed:
A-type: @ smsalertsonline.com 174.36.99.28
A-type: www.smsalertsonline.com 174.36.99.28
MX entry: @ smsalertsonline.com - Mailer-server: smsalertsonline.com

Could it be a problem with sendmail?  Is something not configured properly?  Exim?
0
Comment
Question by:rom109
1 Comment
 
LVL 11

Accepted Solution

by:
VanHackman earned 500 total points
ID: 34923500
I will be good to take a look over the code that you are using.

But, It's probably a matter of the SMTP server, and no of the Code itselft.

Try using PhpMailer: http://phpmailer.worxware.com/

And if you don't get a better result, ask your hosting provider about if the SMTP server of your account is getting a big load.

Kind regards,
VanHackman.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
One of the most often confused topics in the area DNS is the idea of GLUE records. Specifically, what they are, when they are needed, when they are provided, and how they are created. First, WHAT IS GLUE? To understand GLUE, you must first under…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now