Jump to content

email to myself


Pedestrian

Recommended Posts

Hello,

 

I'm very new to php, so I apologize for the primitive nature of this question. I am using php's mail() function to send an email to myself with no success. Part of my code looks like this:

 

$toaddress = "[email protected]";

$fromaddress = "From: [email protected]";

$subject = "Feedback from web site";

$mailcontent = "Customer name: ".$name."\r\n".

  "Customer email: ".$email."\r\n".

  "Customer comments: ".$feedback."\r\n";

 

mail($toaddress, $subject, $mailcontent, $fromaddress);

 

My php.ini file looks like this:

 

[mail function]

; For Win32 only.

SMTP = localhost

smtp_port = 25

 

; For Win32 only.

; sendmail_from = [email protected]

 

But I only get a warning:

 

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() in C:\Program Files\Apache Group\Apache2\htdocs\processfeedback.php on line 16

 

Would you happen to know what the problem is?

 

~P

Link to comment
https://forums.phpfreaks.com/topic/156705-email-to-myself/
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.