I haven't used php to send mail yet and have some questions.
I see that you can add headers, and these days it is essential to have a
real "from".
But I see you can also do this:
mail('n*****@example.com', 'the subject', 'the message', null,
'-**********@example.com');
Does that only work with sendmail and how can you tell what the MTA
(is that right) is?
Also, how would you include a BCC or Reply To with that?
On a related note, what's with CR LF I see in the examples. I see there
are some issues with the CR, can I simple do this?:
$header=<<<'thisdata'
From: some_from
BCC: some blind copy
thisdata;
and expect that to work?
Jeff 4 1382
On Jul 24, 9:27*am, Jeff <jeff@spam_me_not.comwrote:
* I haven't used php to send mail yet and have some questions.
I see that you can add headers, and these days it is essential to have a
real "from".
* But I see you can also do this:
mail('nob...@example.com', 'the subject', 'the message', null,
* * '-fwebmas...@example.com');
* *Does that only work with sendmail and how can you tell what the MTA
(is that right) is?
* *Also, how would you include a BCC or Reply To with that?
On a related note, what's with CR LF I see in the examples. I see there
are some issues with the CR, can I simple do this?:
$header=<<<'thisdata'
From: some_from
BCC: some blind copy
thisdata;
and expect that to work?
* *Jeff
Hey here's some help.
With the PHP mail() function the From MUST be included either in the
php.ini file or in the headers section otherwise it returns a warning.
Separate headers are separated by CRLF in the form of "\r\n" for
example:
$headers = "From: ex*****@example.com" . "\r\n" . "Cc: ex******@example.com" . "\r\n" . "Bcc: ex******@example.com" . "\r
\n" . "Reply-To:ex******@example.com";
Note: If messages are not received, try using a LF (\n) only. Some
poor quality Unix mail transfer agents replace LF by CRLF
automatically (which leads to doubling CR if CRLF is used). This
should be a last resort, as it does not comply with » RFC 2822.
the mail() would then be something like:
mail($to, $subject, $message, $headers)
I hope that helped if more assistance is needed check out PHPs website
they have very useful documentation: http://us.php.net/manual/en/function.mail.php
*** Jeff escribió/wrote (Thu, 24 Jul 2008 09:27:37 -0400):
I see that you can add headers, and these days it is essential to have a
real "from".
But I see you can also do this:
mail('n*****@example.com', 'the subject', 'the message', null,
'-**********@example.com');
Does that only work with sendmail and how can you tell what the MTA
(is that right) is?
If I'm not wrong, it works with Sendmail *and* Sendmail-compatible MTAs
such as Postfix or Qmail. But you must be aware that -f sets the
Return-Path address, not the From header: they're different things.
Also, how would you include a BCC or Reply To with that?
These are regular headers: just append them to the fourth parameter of
mail():
mail('n*****@example.com', 'the subject', 'the message',
"From: we*******@example.com\nBcc: fo*@example.com\nReply-To: ba*@example.com',
'-**********@example.com');
On a related note, what's with CR LF I see in the examples. I see there
are some issues with the CR, can I simple do this?:
$header=<<<'thisdata'
From: some_from
BCC: some blind copy
thisdata;
and expect that to work?
Short answer: yes. Specs say that e-mail should use \r\n but \n tends to
work in practice and I've even seen \r\n failing some times...
Just be careful with $header; if extra line feeds get added, headers will
jump to the message body.
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor en cubitos: http://www.demogracia.com
--
On Thu, 24 Jul 2008 19:03:12 +0200, Álvaro G. Vicario wrote:
*** Jeff escribió/wrote (Thu, 24 Jul 2008 09:27:37 -0400):
>I see that you can add headers, and these days it is essential to have a real "from".
But I see you can also do this:
mail('n*****@example.com', 'the subject', 'the message', null, '-**********@example.com');
Does that only work with sendmail and how can you tell what the MTA (is that right) is?
If I'm not wrong, it works with Sendmail *and* Sendmail-compatible MTAs
such as Postfix or Qmail. But you must be aware that -f sets the
Return-Path address, not the From header: they're different things.
And you need both, not necessarily set to the same thing. The From: can
go to the email address for someone to answer questions, the From_ needs
to go to someone (or some process) that handles undeliverable mail.
Neither should be set to a "noreply" or invalid or nonfunctional
address. Some anti-spam measures will check either or both for
functionality.
--
36. I will not imprison members of the same party in the same cell block, let
alone the same cell. If they are important prisoners, I will keep the only
key to the cell door on my person instead of handing out copies to every
bottom-rung guard in the prison. --Peter Anspach's Evil Overlord List
Peter H. Coffin wrote:
On Thu, 24 Jul 2008 19:03:12 +0200, Álvaro G. Vicario wrote:
>*** Jeff escribió/wrote (Thu, 24 Jul 2008 09:27:37 -0400):
>>I see that you can add headers, and these days it is essential to have a real "from".
But I see you can also do this:
mail('n*****@example.com', 'the subject', 'the message', null, '-**********@example.com');
Does that only work with sendmail and how can you tell what the MTA (is that right) is?
If I'm not wrong, it works with Sendmail *and* Sendmail-compatible MTAs such as Postfix or Qmail. But you must be aware that -f sets the Return-Path address, not the From header: they're different things.
And you need both, not necessarily set to the same thing. The From: can
go to the email address for someone to answer questions, the From_ needs
to go to someone (or some process) that handles undeliverable mail.
Neither should be set to a "noreply" or invalid or nonfunctional
address. Some anti-spam measures will check either or both for
functionality.
Can you talk a bit more about the Return Path? How would you set that as
a header?
And, I understand that some mail clients look at something like a
return path and this should be set somewhere on the site for the server
to check. I'm quite hazy on all this and any clarification would be a
huge help.
Jeff
>
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Geoff Soper |
last post by:
I'm using the mail() function to send e-mails. The first argument to the
function is the e-mail address the mail will be sent to. I understand this
should just be in the format 'address@domain' and...
|
by: knoak |
last post by:
Hi there,
I've found a script at these great Google fora. a script
to send emails with attachments.
The script is below this message, name etc. aren't mine, but from
the original post.
My...
|
by: BigSizeXXL |
last post by:
hi, i'm new to python and have a couple of questions about working
with smtp. i read that you need a pop3 service for receiving mails. i
want to create my own (private) mail service. i'm using a...
|
by: Alessandro Brollo |
last post by:
Far from a professional programmer, I'm simply a
newbie Python user. Two basic questions:
1. I don't want to post banal questions about Python
to main Python list. Does a "banal Python questions...
|
by: RN |
last post by:
I am tired of sending mail from the built-in SMTP service for so many
reasons (errors are nondescriptive in the event log, it doesn't let me
control which IP address it sends from, and it...
|
by: GeorgeAtkins |
last post by:
I want to create a web-based form or page that consists of a series of
formatted questions and answers. The form will resemble an existing paper
form. When the form is filled in, I want the user to...
|
by: Zeeway |
last post by:
hi,everybody
I use dotnet 2005 and c sharp to deliever a mail to a certain mail
address,but it failed with messages such as "invalid parameter,the server
response: decode failed". My codes is...
|
by: =?Utf-8?B?dHBhcmtzNjk=?= |
last post by:
I have a web page that at the click of a button must send a bunch (1000+)
emails. Each email is sent individually. I have the code working fine,
using Mail Message classes and smtp and all that. ...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| |