Jump to content

PHP Mail on Windows Server 2003


Sid9678

Recommended Posts

I Installed PHP version 5.2.3 on my Windows Server 2003 machine. PHP is working, my server is serving php pages. I cannot get my php mail page to work. It does not send e-mail. I do have SMTP installed on my server and I can send e-mail but the php page is not sending the e-mail. I'm getting the following error message: Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in C:\Inetpub\phpmail.images4kids.com\mailtest.php on line 43

 

Can someone please help me get this resolved?

Link to comment
Share on other sites

  • 2 weeks later...

Hello ...

i'm just new in php. here's what i find at http://id2.php.net/manual/en/book.mail.php.

 

thx to these guy.

 

======================================

 

To test PHP's mail function, utilized the below :

 

<?php

 

$Name = "Da Duder"; //senders name

$email = "email@adress.com"; //senders e-mail adress

$recipient = "PersonWhoGetsIt@emailadress.com"; //recipient

$mail_body = "The text for the mail..."; //mail body

$subject = "Subject for reviever"; //subject

$header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields

 

mail($recipient, $subject, $mail_body, $header); //mail command :)

?>

 

If did not work ... try this.

 

<?php

 

$Name = "Da Duder"; //senders name

$email = "email@adress.com"; //senders e-mail adress

$recipient = "PersonWhoGetsIt@emailadress.com"; //recipient

$mail_body = "The text for the mail..."; //mail body

$subject = "Subject for reviever"; //subject

$header = "From: ". $Name . " <" . $email . ">\r\n"; //optional headerfields

 

ini_set('sendmail_from', 'me@domain.com'); //Suggested by "Some Guy"

 

mail($recipient, $subject, $mail_body, $header); //mail command :)

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.