Hai Friends..
I am using the simple form of mail() function. I am giving the code down.I am writing code for mail sending function in a feedback form. The mails are always sent to the variable $this->to_mail in the code and the visitors are putting their mail id in $this->from_mail in code.
[code=php]
if(isset($_POST['sub']))
{
echo "The Post is not empty";
$this->from_mail = $_POST['frm_mail_id'];//
$this->mail_header = "From: $this->from_mail";
echo "The Header is : ".$this->mail_header;
echo "The Sender's Mail Id is : ".$this->from_mail;
$this->to_mail = "syammohan_ch@y ahoo.com";
$this->subject = $_POST['subject'];
echo "The Subject is : ".$this->subject;
$this->message = $_POST['message'];
echo "The Message is : ".$this->message;
mail($this->to_mail,$thi s->subject,$thi s->message,$thi s->mail_header) ;[/code]
but i am getting the error saying that
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
my php.ini settings are
[Please use CODE tags when posting source code. Thanks! --pbmods]
I am using the simple form of mail() function. I am giving the code down.I am writing code for mail sending function in a feedback form. The mails are always sent to the variable $this->to_mail in the code and the visitors are putting their mail id in $this->from_mail in code.
[code=php]
if(isset($_POST['sub']))
{
echo "The Post is not empty";
$this->from_mail = $_POST['frm_mail_id'];//
$this->mail_header = "From: $this->from_mail";
echo "The Header is : ".$this->mail_header;
echo "The Sender's Mail Id is : ".$this->from_mail;
$this->to_mail = "syammohan_ch@y ahoo.com";
$this->subject = $_POST['subject'];
echo "The Subject is : ".$this->subject;
$this->message = $_POST['message'];
echo "The Message is : ".$this->message;
mail($this->to_mail,$thi s->subject,$thi s->message,$thi s->mail_header) ;[/code]
but i am getting the error saying that
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
my php.ini settings are
Code:
[mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 ; For Win32 only. sendmail_from = me@example.com thanks in advance.. //$this->doMail(); }
Comment