Hi folks - first, I apologize if in wrong subject category.
My problem. Simple feedback form using php to email completed form notification to myself.
My error: "PHP Warning: mail(): Failed to connect to mailserver at "smtp.yourisp.net"
My system:
Windows
Apache 2.2.0
PHP 5.1.2
feedback php:
Code: Select all
<?php
require("class.phpmailer.php");
$msg = "Name:t$namen";
$msg .= "Email:t$emailn";
$msg .= "Comments:t$commentsn";
$recipient = "myemail@mydomain.org";
$subject = "New Feedback from my site";
$mailheaders = "From:$emailn";
$mailheaders .= "Reply-To:$emailnn";
mail($recipient, $subject, $msg, $mailheaders);
header("Location: http://mywebsite/feedback/thankyou.html");
?>
Code: Select all
/////////////////////////////////////////////////
// PROPERTIES FOR SMTP
/////////////////////////////////////////////////
/**
* Sets the SMTP hosts. All hosts must be separated by a
* semicolon. You can also specify a different port
* for each host by using this format: [hostname:port]
* (e.g. "smtp1.example.com:25;smtp2.example.com").
* Hosts will be tried in order.
* @var string
*/
public $Host = 'my_isp.net';
/**
* Sets the default SMTP server port.
* @var int
*/
public $Port = 25;
/**
* Sets the SMTP HELO of the message (Default is $Hostname).
* @var string
*/
public $Helo = '';
/**
* Sets connection prefix.
* Options are "", "ssl" or "tls"
* @var string
*/
public $SMTPSecure = "";
/**
* Sets SMTP authentication. Utilizes the Username and Password variables.
* @var bool
*/
public $SMTPAuth = true;
/**
* Sets SMTP username.
* @var string
*/
public $Username = 'myemail@charter.net';
/**
* Sets SMTP password.
* @var string
*/
public $Password = 'mypassword';
/**
* Sets the SMTP server timeout in seconds. This function will not
* work with the win32 version.
* @var int
*/
public $Timeout = 10;
/**
* Sets SMTP class debugging on or off.
* @var bool
*/
public $SMTPDebug = false;
/**
* Prevents the SMTP connection from being closed after each mail
* sending. If this is set to true then to close the connection
* requires an explicit call to SmtpClose().
* @var bool
*/
public $SMTPKeepAlive = false;
/**
* Provides the ability to have the TO field process individual
* emails, instead of sending to entire TO addresses
* @var bool
*/
public $SingleTo = false;
[mail function]
; For Win32 only.
SMTP = my.isp.net
smtp_port = 25
; For Win32 only.
sendmail_from = myemail@charter.net
I'm at my wits end here if someone could provide some guidance or simply point me in the right direction.
Best regards.
~pickle | Please use [ code=html ], [ code=php ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: