Solved

PHPMailer

Posted on 2014-10-14
6
366 Views
Last Modified: 2014-10-15
Dear experts,

I wish to know the difference between Mail(), IsSMTP(), and IsSendMail() function from a php library called PHPMailer.

When should I use what function and which will be a better choice if I use a online web hosting plan as in shared hosting instead of dedicated host. Thanks

I've encountered an issue which I called a function Send() but the program didn't send out an email.

If i use SMTPDebug, will it shows me the possible errors?
0
Comment
Question by:Kinderly Wade
6 Comments
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 40381473
Even if you use SMTP , you need to be enabled the SMTP account on the hosting package.

Otherwise, you can use google (gmail) smtp details to send email from your hosting.  

ref. http://phpmailer.worxware.com/?pg=examplebgmail

It has example of gmail smtp with error display details.
0
 
LVL 36

Expert Comment

by:Loganathan Natarajan
ID: 40381496
If i use SMTPDebug, will it shows me the possible errors?

Open in new window


 $mail->ErrorInfo;   this will list out the possible errors on SMTP related.

like,
SMTP -> ERROR: Failed to connect to server: Connection timed out (110)
SMTP Error: Could not connect to SMTP host.
0
 
LVL 25

Accepted Solution

by:
Squinky earned 500 total points
ID: 40381600
Please don't link to obsolete docs - PHPMailer moved to Github ages ago.

The differences are:

isMail(): sends using PHP's built-in mail() function, which usually means it will call your local sendmail binary internally, as determined by your php.ini settings. You need to have a local mail server for this to work.

isSendmail(): send by calling your local sendmail binary directly via popen() - this can be slightly faster, and also give you a little more control if you're using a non-standard sendmail (e.g. like qmail's emulation). You need to have a local mail server for this to work.

isQmail(): the same as this but changes the default path to qmail's qmail-inject binary, and alters the command line params to be compatible with qmuil.

isSMTP(): sends using SMTP directly to a specific server. This uses the bundled SMTP PHP class. The advantage of this is that you gain fine control over the SMTP conversation, detailed feedback on delivery, and you can send from servers that do not have a local mail server installed (e.g. most Winfows servers). Its main disadvantages are that it can be slow (SMTP is not good for interactive use (e.g. during a page submission)), and it's not a complete MTA and does not handle queuing, bounces, retries etc.

SMTPDebug shows debug information about and during the SMTP conversation and complete session transcript. It accepts values between 0 and 4, where 0 is no debug info and 4 is the most.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Closing Comment

by:Kinderly Wade
ID: 40381785
Thanks Squinky. You just answered my question right on the spot.
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 40381788
I expect you're at the threshold of a journey that will be filled with darkness, anguish and frustration.  Email is one of those things that seems like it should be so easy... Until you try to make the email system work in a secure, predictable and sensible manner.  Then you find that it's full of bad design, hopeless incompatibilities, competing ISPs, spam, viruses, phishing, bizarre data losses, stolen identities, fraudulent messages, and a complete lack of accountability.  Your journey will include many angry phone calls saying, "I didn't get the email!" and "Why am I getting this email?" and "Why did he get the email before I did?"  When you find (as we all do) that your time spent wrestling with your automated email is a real drag on your life, you'll wish for an alternative.  

In 2008, I shut down all the automated email systems I had written (thousands of clients) and turned to ConstantContact.com.  I recommend that you use Constant Contact instead of trying to use an automated PHP library that you don't understand.  CC are efficient, effective and embarrassingly inexpensive, when compared to the time and cost that you're facing by trying to do all of this yourself.

There are competing services, for example Mail Chimp, and the like, but CC was the most professional and there was essentially no difference in cost.  They offer a free trial and can have you up and running within a few minutes.  Most importantly, they are consummate professionals who truly understand the email system and who spend 100% of their professional life getting email right.  When I first experienced their service I was reminded of the famous quote from the firefighter Red Adair: "If you think it's expensive to hire a professional, just wait till you hire an amateur!"

Firing myself and hiring Constant Contact is a decision I have never regretted.  Best of luck with your project, ~Ray
0
 

Author Comment

by:Kinderly Wade
ID: 40381813
Hi Ray,

Thanks for suggesting alternative method. Yes I did get complaints of customer not receiving the emails.... The actual reason why that something I can't answer but I believe it is probably categorized as spam or somehow the client email filtered out the email (very very hard to predict).

I will definitely give ConstantContact.com a try. Thanks again Ray.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

757 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

19 Experts available now in Live!

Get 1:1 Help Now