Hello there....
I have installed the apache 1.3 to run 'locally' in my home win98 system...(Not as a service)...
1. With apache configured like this, can i use mail() function to send an e-mail?How?
2. If yes...what should be the SMTP: ... value in php.ini? The same as in my outlook express6's-->tools-->accounts-->Mail properties-->servers-->Outgoing mail (SMTP): thisvalue?
3. can the value sendmail_from: ...... really be anything with an @ in middle?
Thanks....
does mail() work with 'local' apache?
Moderator: General Moderators
- yes, php/win32 has its own smtp implementation "on board"
- yes, but keep in mind that the standard implementation cannot handle smtp-authentication.
- depends on your isp/mail-gateway. My isp at home e.g. requires the from: field to be either my customeriD or one alias I chose when setting up the account
so why then.....with the configuration explained above, when i run:
i get on browser:
Code: Select all
<?php
$address="***@***.***";
$subject="hello";
$text="This is a test";
$header="From: Remider <***@***.***>\r\n";
$header .="MIME-Version: 1.0\r\n";
$header .="Content-type: text/html\r\n";
$success=mail($address,$subject,$text,$header);
if($success){
print("\$success is: $success ... GOOD<br />");
}else{
print("\$success is: $success ... NO LUCK<br />");
}
?>Thanks again....Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in c:\mydir\sample.php on line 8
$success is: ... NO LUCK
So you have to set the proper value in your php.inihttp://php.net/manual/en/function.mail.php wrote: The Windows implementation of mail() differs in many ways from the Unix implementation [...] Second, the custom headers like From:, Cc:, Bcc: and Date: are not interpreted by the MTA in the first place, but are parsed by PHP. PHP < 4.3 only supported the Cc: header element (and was case-sensitive). PHP >= 4.3 supports all the mentioned header elements and is no longer case-sensitive.
Code: Select all
; For Win32 only.
sendmail_from = ...ok volka.....i have seen that....but still.....
1. There is nothing wrong with the code above....and my PHP is 4.3.2
2. My doubts are in my php.ini settings....where should i look to find the right settings???????
I have these settings:
SMTP:.... same as in my outlook express6-->tools-->accounts-->Mail properties-->servers-->Outgoing mail (SMTP): thisvalue...
sendmail_from:....quote from my study guide:"a string containing the email address of your default PHP mail sender"....so practically anything in form: some@example.com
But still the browser complains:
Please help.......
PS. is it necessary to enclose the php.ini settings in double or single quotes?
1. There is nothing wrong with the code above....and my PHP is 4.3.2
2. My doubts are in my php.ini settings....where should i look to find the right settings???????
I have these settings:
SMTP:.... same as in my outlook express6-->tools-->accounts-->Mail properties-->servers-->Outgoing mail (SMTP): thisvalue...
sendmail_from:....quote from my study guide:"a string containing the email address of your default PHP mail sender"....so practically anything in form: some@example.com
But still the browser complains:
WHY......or custom "From:" header missing in c:\mydir\sample.php on line 8.......IT IS NOT MISSING!!!!!!!Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in c:\mydir\sample.php on line 8
$success is: ... NO LUCK
Please help.......
PS. is it necessary to enclose the php.ini settings in double or single quotes?
hm, then I have to admit I'm totally clueless.
Did you try the simple examples at http://php.net/manual/en/function.mail.php ?
Did you try the simple examples at http://php.net/manual/en/function.mail.php ?