The only code I have is this:
$to = 'otlzack@yahoo.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: otlzack@yahoo.com' . "\r\n" .
'Reply-To: otlzack@yahoo.com' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
That came straight from the php manual.
Now I must be missing something because this error occurs:
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 Software Foundation\Apache2.2\htdocs\profile.php on line 13
So I check my php.ini:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = localhost
; http://php.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from = me@example.com
Is this good? I honestly have no idea.
What more is needed? Does the mail function actually work this way? The otlzack@yahoo.com is just some random yahoo account I've had for years, does the email address need to somehow be affiliated with my server? If so, how?
And I'm not even sure about the smtp_port = 25 part. Do I have to manually set the smtp_port on my computer to use 25? If so, how do you do that? I know next to nothing about that kind of stuff.
Hopefully somebody can clear this up for me. I'm just really confused as to how this function actually works and I'd love to get it working for a Forgot Password page I'd like to implement.
Not sure if it's relevant, but my OS is Windows.
Thanks!
This post has been edited by eZACKe: 04 June 2011 - 10:09 PM

New Topic/Question
Reply




MultiQuote




|