PHPMailer Problems

software development

#1

Hello:

I have problems with PHPMailer since I moved from gmail to Dreamhost email service.

This is the code:

[php]function send_mail( $params = NULL, $debug = 0) {
// ROOT = $_SERVER[‘DOCUMENT_ROOT’];
require_once( ROOT . ‘/includes/phpmailer/class.phpmailer.php’ );

$mail = new PHPMailer();
$return = ‘’;

$mail->IsSMTP();
$mail->Host = ‘mail.nicomv.com’;
$mail->SMTPDebug = $debug; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
// EMAIL = contacto@nicomv.com; I have tried using ‘contacto@nicomv.com’ string instead of a defined variable.
$mail->Username = EMAIL;
$mail->Password = ‘myPassword’;
$mail->WordWrap = 70;
$mail->SetFrom( $params[‘from’], utf8_encode( $params[‘fromName’] ) );
$mail->AddReplyTo( $params[‘from’], utf8_encode( $params[‘fromName’] ) );
$mail->AddAddress( EMAIL );
$mail->Subject = utf8_encode( $params[‘subject’] );

if( isset( $params[‘html’] ) && $params[‘html’] === true )
$mail->IsHTML( true );

$mail->Body = $params[‘message’];

if( ! $mail->Send() ) {
$return = $mail->ErrorInfo;
} else {
$return = ‘1’;
}

return $return;
}[/php]

Using this code I get:

** The URL provided says that the changes were rolled back, so I assume that it should not be the problem.

But if I change the $mail->Host = ‘localhost’ and the $mail->User and $mail->Password to the SSH user and password (as specified in the Dreamhost wiki) respectively, the email is sent (without errors), but never reaches the inbox (it does not reach anywhere :P).

I can send emails from the account and receive/send from mail clients (like Mozilla Thunderbird). I’ve checked the error.log but there was nothing related to this issue.

Thanks in advance :).

PD.: this is the form that has the problems: nicomv.com/contact/


#2

Is that the from address of the person submitting the form?

Is that the from address of the person submitting the form?


#3

Yes XD. I did not realize it… so embarrased :(.

Sorry for the trouble :P.