PHP mail problem

software development

#1

I want to put a contact form on my website, and use mail.php to send a message to my mailbox, throught my SMTP, but when I exec this code:

<?php require_once "Mail.php"; $from = "David "; $to = "David Recipient "; $subject = "PHP mail test"; $body = "Hi,\n\nHow are you?"; $host = "mail.intarex.com"; $username = "alpha"; $password = "aaassxxcc"; $ip = gethostbyname($host); echo("

Send mail to: " . $host ."(" . $ip . ")

"); $headers = array ('From' => $from, 'To' => $to, 'Subject' => $subject); $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); $mail = $smtp->send($to, $headers, $body); if (PEAR::isError($mail)) { echo("

Error

"); echo("

" . $mail->getMessage() . "

"); } else { echo("

Message successfully sent!

"); } ?>

I get this result:


Send mail to: mail.intarex.com(80.38.238.144)

Error

Failed to connect to mail.intarex.com:25 [SMTP: Failed to connect socket: Connection refused (code: -1, response: )]

but my smtp is up and working. Any ideas about this error?

Thanks in advance.


#2

http://www.dreamhoststatus.com/2009/05/12/upcoming-shared-http-server-outbound-mail-policy-change/

Customer since 2000 :cool: openvein.org | Please don’t feed the trolls. :@


#3

Thanks for your help.