By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,677 Members | 1,877 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,677 IT Pros & Developers. It's quick & easy.

userID is sent as FROM field when using mail() - how to avoid?

P: n/a
WHen I use php's mail() function, the recipient sees the hosting userID -
NOT GOOD!.

Are there any settings I can change or code it a different way?

Thanks.
Jul 17 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
NotGiven <no****@nonegiven.net> wrote:
WHen I use php's mail() function, the recipient sees the hosting userID -
NOT GOOD!.

Are there any settings I can change or code it a different way?


RTFM: http://www.php.net/manual/en/function.mail.php

"The additional_parameters parameter can be used to pass an additional
parameter to the program configured to use when sending mail using the
sendmail_path configuration setting. For example, this can be used to
set the envelope sender address when using sendmail with the -f sendmail
option. You may need to add the user that your web server runs as to
your sendmail configuration to prevent a 'X-Warning' header from being
added to the message when you set the envelope sender using this
method."

--

Daniel Tryba

Jul 17 '05 #2

P: n/a
ALthough I appreciate the reply's advice in reading the manual, I have done
so and it STILL does not work. I learned the setting in PHP.INI,
sendmail_from is the setting in question.
"NotGiven" <no****@nonegiven.net> wrote in message
news:Nw******************@bignews3.bellsouth.net.. .
WHen I use php's mail() function, the recipient sees the hosting userID -
NOT GOOD!.

Are there any settings I can change or code it a different way?

Thanks.

Jul 17 '05 #3

P: n/a
*** NotGiven escribió/wrote (Fri, 3 Sep 2004 09:43:29 -0400):
WHen I use php's mail() function, the recipient sees the hosting userID -
NOT GOOD!.


That's kind of unrelated to PHP. Some mail servers (MTA) add that header to
mail received through the sendmail interface--i.e. through a local
executable rather than port 25. Postfix does so. That's the way mail()
sends mail.

If your user IDs are confidential, you can either reconfigure your MTA (if
that's possible) or find another mail function that opens sockets to send
mail. For instance:

http://pear.php.net/package/Mail (choose SMTP backend)

--
--
-+ Álvaro G. Vicario - Burgos, Spain - ICQ 46788716
+- http://www.demogracia.com (la web de humor para mayores de 100 años)
++ «Sonríe, que te vamos a hacer una foto para la esquela»
--
Jul 17 '05 #4

P: n/a
*** NotGiven escribió/wrote (Fri, 3 Sep 2004 09:43:29 -0400):
WHen I use php's mail() function, the recipient sees the hosting userID -
NOT GOOD!.


Is it the 'From' header or the 'Received' one?

Received: by smtp.******.com (Postfix, from userid 48)
id 5BCCF3F89; Wed, 1 Sep 2004 16:25:08 +0200 (CEST)

In the first case, just add a From header:

mail($to, $subject, $message, 'From: fr**@example.com');

If that doesn't work, use the fifth parameter:

mail($to, $subject, $message,
'From: fr**@example.com', '-ffr**@example.com');

In the latter case, send mail using sockets rather than local sendmail
executable. This class allows to do you:

http://pear.php.net/package/Mail (choose SMTP backend)


--
--
-+ Álvaro G. Vicario - Burgos, Spain - ICQ 46788716
+- http://www.demogracia.com (la web de humor para mayores de 100 años)
++ «Sonríe, que te vamos a hacer una foto para la esquela»
--
Jul 17 '05 #5

P: n/a

"NotGiven" <no****@nonegiven.net> wrote in message
news:Nw******************@bignews3.bellsouth.net.. .
WHen I use php's mail() function, the recipient sees the hosting userID -
NOT GOOD!.

Are there any settings I can change or code it a different way?

Thanks.

Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.