Solved

PHPMailer

Posted on 2014-10-14
6
388 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:
Marcus Bointon 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
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Closing Comment

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

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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

726 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