phpMailer in hostmonster doesn´t connect...What fails?

Posted on 2009-05-07
Last Modified: 2013-12-17
Hi Experts!

I waste to many time trying to resolve a problem with my phpMailer configuration. I ´ve a hostmonster hosting and in forums I ´ve seen that is OK sending email, but, to me is n´t.

The configuration that I added is:
$mail->Host      = "";

	$mail->Mailer    = "smtp";

	$mail->Port      = 26;                   //25 isnot

	$mail->SMTPAuth  = true;

	$mail->Username   = ""; 		// SMTP account username

	$mail->Password   = "XXXXXXX";        			// SMTP account password

Open in new window

Question by:javiermorquecho
  • 3

Expert Comment

ID: 24333935
please see the correct example here:

following code is send demo mail via SMTP Server



//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

$mail             = new PHPMailer();

$body             = "Hello";

$mail->IsSMTP(); // telling the class to use SMTP

$mail->Host       = ""; // SMTP server

$mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)

                                           // 1 = errors and messages

                                           // 2 = messages only

$mail->SMTPAuth   = true;                  // enable SMTP authentication

$mail->Host       = ""; // sets the SMTP server

$mail->Port       = 26;                    // set the SMTP port for the GMAIL server

$mail->Username   = "yourname@yourdomain"; // SMTP account username

$mail->Password   = "yourpassword";        // SMTP account password

$mail->SetFrom('', 'First Last');

$mail->AddReplyTo("","First Last");

$mail->Subject    = "PHPMailer Test Subject via smtp, basic with authentication";

$mail->AltBody    = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test


$address = "";

$mail->AddAddress($address, "John Doe");

if(!$mail->Send()) {

  echo "Mailer Error: " . $mail->ErrorInfo;

} else {

  echo "Message sent!";



Open in new window


Author Comment

ID: 24337362
Hi ycTIN!

I will try!

LVL 17

Accepted Solution

nplib earned 500 total points
ID: 24338542
some hosting servers don't allow through smtp.

I use midphase hosting solution and I have to use
$mail->Mailer    = "mail";


$mail->Port      = 26;                   //25 isnot
        $mail->SMTPAuth  = true;
        $mail->Username   = "";                 // SMTP account username
        $mail->Password   = "XXXXXXX";                          // SMTP account password
from your script

Author Comment

ID: 24341195
Hi plib!

I will try it!


Author Closing Comment

ID: 31579331
Thnx nplib, you´re right!!!

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
This article discusses how to create an extensible mechanism for linked drop downs.
In this video we show how to create a Shared Mailbox in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Recipients >> Sha…
The viewer will learn how to count occurrences of each item in an array.

746 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

11 Experts available now in Live!

Get 1:1 Help Now