email problem

Sean picasso@madflower.com
Mon, 15 Oct 2001 07:32:07 -0400 (EDT)


You might need to create a user with the name you are sending it from and
use this format.

To use "FirstName LastName <user@foo.tld>"
Try this:
mail($toName." <".$toAddress.">",$subject, $message, "From: ".$fromName."
<".$fromAddress.">");

look at http://www.php.net/manual/en/ref.mail.php
for more help.


On Mon, 15 Oct 2001, Mike Rambo wrote:

> We're using apache/php/mysql for our repair database in the shop.
>
> We need to send an email to an outside 'official' email address under
> certain circumstances. What I've run into is that the server (running
> sendmail) sends the email and sets the From: address to be from the user
> apache runs under on the server box  (nobody@server.domain.local in this
> case). This email gets kicked back from the outside mail server (not
> under our control) as being an invalid email address.
>
> Is there a way to make the email appear to come from a valid user on the
> outside server (repair@lsd.k12.mi.us in this case) so it won't get
> rejected? I've tried setting the From: attribute in the php mail()
> function without any success. The From: gets correctly set in the email
> itself but this has no effect on the account it is sent from using the
> database system.
>
> Oddly enough, if I set kmail on my workstation to use the same server
> box to send mail but specify a valid address that the email comes from I
> find that all mail forwards through the box just fine. I've looked
> through the sendmail config but haven't found anything. I know the box
> can forward the mail and I know the outside server will accept it so
> long as it comes from a valid email address but I can't get the
> apache/php stuff to use the address I need. What am I missing?
>
> Thanks.
>
>
>