Solved

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

Posted on 2009-05-07
5
1,748 Views
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.website.com";
	$mail->Mailer    = "smtp";
	$mail->Port      = 26;                   //25 isnot
	$mail->SMTPAuth  = true;
	$mail->Username   = "info@website.com"; 		// SMTP account username
	$mail->Password   = "XXXXXXX";        			// SMTP account password

Open in new window

0
Comment
Question by:javiermorquecho
[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
  • 3
5 Comments
 
LVL 7

Expert Comment

by:ycTIN
ID: 24333935
please see the correct example here:
http://phpmailer.codeworxtech.com/index.php?pg=examples

following code is send demo mail via SMTP Server

<?php
require_once('../class.phpmailer.php');
//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       = "mail.yourdomain.com"; // 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       = "mail.yourdomain.com"; // 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('name@yourdomain.com', 'First Last');
 
$mail->AddReplyTo("name@yourdomain.com","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
 
$mail->MsgHTML($body);
 
$address = "whoto@otherdomain.com";
$mail->AddAddress($address, "John Doe");
 
 
if(!$mail->Send()) {
  echo "Mailer Error: " . $mail->ErrorInfo;
} else {
  echo "Message sent!";
}
?>

Open in new window

0
 

Author Comment

by:javiermorquecho
ID: 24337362
Hi ycTIN!

I will try!

Thnx
0
 
LVL 17

Accepted Solution

by:
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";

remove

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

Author Comment

by:javiermorquecho
ID: 24341195
Hi plib!

I will try it!

Thnx
0
 

Author Closing Comment

by:javiermorquecho
ID: 31579331
Thnx nplib, you´re right!!!
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
To show how to create a transport rule 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 Mail Flow >> Rules tab.:  To cr…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

717 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