Re: Mail Again
| From: | David Robley | Date: | Tue, 23 Apr 2002 00:41:45 +0000 |
| Subject: | Re: Mail Again | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-18745@lists.php.net to get a copy of this message | ||
In article <20020422204015.20248.qmail@pb1.pair.com>,
afrancis@camerondesign.co.uk says...
> Got almost everything to work. Thank you all for your input. Code as
> follows:
> <?include ("../config.inc.php"); ?>
>
> <?php
>
> // setup SQL statement to retrieve link
>
> $SQL = " SELECT * FROM $tablename1 ";
> $SQL = $SQL . " WHERE id = $id ";
>
> // execute SQL statement
> $ret = mysql_db_query($dbname,$SQL,$link);
>
> if (!$ret) { echo("ERROR: " . mysql_error() . "\n$SQL\n"); }
>
> echo ("<P><B> Email Sent</B></P>\n");
>
> // retrieve values
> $row = mysql_fetch_array($ret);
> $email = $row["email"];
> $title = $row["title"];
> $comments = $row["comments"];
> $title = $row["title"];
>
> mail($email, $title, $comments, $emailaddress);
>
>
> mysql_close($link);
>
> ?>
>
> $emailaddress is set in the config.inc.php file and comes in alright as a
> header in the note.
>
> However, the mail is sent from the following:
> nobody [nobody@romeo.xcalibre.co.uk]
>
> Is there a way to tell the PHP Server where the mail is coming from.
There is an item in your php.ini
sendmail_from string
Which "From:" mail address should be used in mail sent from PHP under
Windows.
If you look at the docs for mail(), you'll see that there are
also examples of using the fourth argument to mail() for extra headers,
including the From: header. I am not sure whether using From: under
Windows works in lieu of the php.ini entry.
--
David Robley
Temporary Kiwi!
Quod subigo farinam