Ask a Question related to Dreamweaver AppDev, Design and Development.
-
Josh Johnson #1
PHP Mail Header and New Lines
I'm using PHP to send out email to users when they submit a form (user
registration). The email gets sent just fine, but I'd like to be able to
send HTML emails as well. After consulting php.net, I noted that I have
to add the correct headers to the email. My problem is that the carriage
returns and new lines are being parsed as regular characters, so the
headers are incomplete. Example:
MIME-Version: 1.0\r\n Content-type: text/html; charset=iso-8859-1
Where is should instead be:
MIME-Version: 1.0
Content-type: text/html; charset=iso-8859-1
I know the servers are Unix servers, so I've even tried removing the
Windows \r, but it doesn't seem to help. Anyone know what's wrong and
why it's not adhering to the new line?
- Josh
Josh Johnson Guest
-
Using PHP to parse mail header
Hello! I am very new to PHP (or any type of scripting language), and am trying to write a PHP script that will accept email headers posted into a... -
manipulate mail header
Hi! Its me again. Sorry for the last post - it was quite clumsy. In fact, it wasn't really what I need. I have a mail and I want to fake the... -
[PHP] Mail Header/Return Receipt
Disposition-Notification-To: is not a sure bet, since the majority of people ignore the return receipt. The only way you will know if the email... -
Mail Header/Return Receipt
Ok, I have an interesting one here. I'm trying to send an e-mail from Server A, through Server B, and to a recipient using PHP on Server A. Server... -
LWP Extra Header Lines
Hi, Does anyone know how to add extra request header lines with LWP? I've seen this way but thought I'd see if there's a 'better' way: my... -
Josh Johnson #2
Re: PHP Mail Header and New Lines
Here's the example code I'm working with:
function sendEmail() {
$headers = 'MIME-Version: 1.0\r\n ';
$headers .= 'Content-type: text/html; charset=iso-8859-1 ';
$to = $name . ' <' . $address . '>';
$subject = 'User Registration';
$message = '<html><body><p>';
$message .= 'Canned message here';
$message .= '</p></body></html>';
mail($to, $subject, $message, $headers);
}
Josh Johnson Guest
-
Kerry Snow #3
Re: PHP Mail Header and New Lines
Josh,
First, I apologize for being of no help, regarding your question. I'm just
learning PHP, and have many more quesstions than answers.
With that in mind, I'm trying to set up forms on my pages to automatically
e-mail to specified addresses, when the form is submitted to the database.
It sounds like you've already figured that out. How did you do that?
Thanks,
Kerry
"Josh Johnson" <josh.johnson@nospam.sun.com> wrote in message
news:d17ssg$26n$1@forums.macromedia.com...> I'm using PHP to send out email to users when they submit a form (user
> registration). The email gets sent just fine, but I'd like to be able to
> send HTML emails as well. After consulting php.net, I noted that I have to
> add the correct headers to the email. My problem is that the carriage
> returns and new lines are being parsed as regular characters, so the
> headers are incomplete. Example:
>
> MIME-Version: 1.0\r\n Content-type: text/html; charset=iso-8859-1
>
> Where is should instead be:
>
> MIME-Version: 1.0
> Content-type: text/html; charset=iso-8859-1
>
> I know the servers are Unix servers, so I've even tried removing the
> Windows \r, but it doesn't seem to help. Anyone know what's wrong and why
> it's not adhering to the new line?
>
> - Josh
Kerry Snow Guest
-
Michael Fesser #4
Re: PHP Mail Header and New Lines
.oO(Josh Johnson)
Use double quotes around the string or PHP won't recognize the special>My problem is that the carriage
>returns and new lines are being parsed as regular characters, so the
>headers are incomplete.
chars.
Micha
Michael Fesser Guest
-
Josh Johnson #5
Re: PHP Mail Header and New Lines
I've been working more javascript than PHP lately, and had forgotten
that PHP treats single and double quotes differently. Thanks for the
reminder!
- Josh
Michael Fesser wrote:> .oO(Josh Johnson)
>
>>>>My problem is that the carriage
>>returns and new lines are being parsed as regular characters, so the
>>headers are incomplete.
>
> Use double quotes around the string or PHP won't recognize the special
> chars.
>
> MichaJosh Johnson Guest



Reply With Quote

