Jump to content

[SOLVED] mail


ROCKINDANO

Recommended Posts

for the past few days i have been working with a mail form, which by the way i can't seem to set it going. yesterday after long hrs of working on it, i was successful. i received a test email from my email form. made a change in the code and the form was not working again.

 

this is what i have in my php.ini file for the SMTP set up:

[mail function]

; For Win32 only.

SMTP = mail.domainhere.local

smtp_port = 25

 

and i have a SMTP installed in my test machine and in our in house mail server. made sure the services are running. now this is what i have in my php code:

    	<?php
		ini_set("display_errors", "1");
		error_reporting(E_ALL);

		//Customer Name
		$custname = $_REQUEST['custname'] ;			
		//Customers Email
		$email = $_REQUEST['email'] ;
		//Customers Feedback
		$message = $_REQUEST['feedback'] ;
		//Subject
		$subject = "Feed Back from website";

		//You (to address)
		$to = "[email protected]";
		$headers = "From: $email";

		ini_set("SMTP","mail.domain.local");
		$sent = mail($to, $subject, $message, $headers);

		if($sent)
		{print "W000t! It works!"; }
		else
		{print "Damn! It dont work"; }

 

the only thing that i get is a warning that says this.

 

Warning: mail() [function.mail]: Failed to connect to mailserver at "mail.domain.local" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in E:\Program Files\Apache Software Foundation\Apache2.2\htdocs\processfeedback.php on line 52

Damn! It dont work

 

any help!?

Link to comment
https://forums.phpfreaks.com/topic/172271-solved-mail/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.