Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #10007

Re: PHP Mailto();

From Twayne <nobody@spamcop.net>
Newsgroups comp.lang.php
Subject Re: PHP Mailto();
Date 2013-07-01 10:23 -0400
Organization Aioe.org NNTP Server
Message-ID <kqs3dn$2s7$1@speranza.aioe.org> (permalink)
References <kqqf0l$7gm$1@speranza.aioe.org> <b3cgt2FdieqU1@mid.individual.net>

Show all headers | View raw


On 2013-07-01 1:03 AM, J.O. Aho wrote:
> On 01/07/13 01:29, Twayne wrote:
>> Hi,
>>
>> Win 7, PHP 5.3.5, XAMPP local server, standard Unix remote server:
>>
>> having a problem with mailto. It's working fine, but ... I can't figure
>> how to get it to contain all the information I want sent to me. I have

>> =========================

...
>
> If you want to add something to the header, then use
> "X-something: data\r\n"
>
> Don't use two "From:", use "X-Sender:" for the $name, don't forget to
> sanitize the user input or else you will end up with mail header
> injections.
>
> $header .= "X-Sender: $name\r\n"; // needs sanitation
> $header .= "X-UserAgent: $browser\r\n"; // needs sanitation
> $header .= "X-IP: $ipAddress\r\n";
>
> To lessen risk for header injections, include those in the body/message.
>
> $comments .= "Abuse Sender: $name\n"; // needs sanitation
> $comments .= "User Agent: $browser\n"; // needs sanitation
> $comments .= "IP: $ipAddress\n";
>

That's a keeper! Thanks much for sharing.

X-sender I hadn't thought of and I'll try it. As for \r\n vs \n, I'd 
forgotten all about because I normally use (not successfully in this 
case) <br />.

I've also been reading about PHP EOL; any opinions on that? Other than 
knowing when to use it, it sounds like it might be handy if it's not 
deprecated; haven't looked it up yet.

Thanks much,

Twayne`

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

PHP Mailto(); Twayne <nobody@spamcop.net> - 2013-06-30 19:29 -0400
  Re: PHP Mailto(); "J.O. Aho" <user@example.net> - 2013-07-01 07:03 +0200
    Re: PHP Mailto(); The Natural Philosopher <tnp@invalid.invalid> - 2013-07-01 10:08 +0100
      Re: PHP Mailto(); Twayne <nobody@spamcop.net> - 2013-07-01 10:33 -0400
    Re: PHP Mailto(); Twayne <nobody@spamcop.net> - 2013-07-01 10:23 -0400
      Re: PHP Mailto(); Tim Streater <timstreater@greenbee.net> - 2013-07-01 16:28 +0100
  Re: PHP Mailto(); bill <william@TechServSys.com> - 2013-07-01 07:50 -0400
    Re: PHP Mailto(); The Natural Philosopher <tnp@invalid.invalid> - 2013-07-01 12:59 +0100
      Re: PHP Mailto(); "J.O. Aho" <user@example.net> - 2013-07-01 14:47 +0200
        Re: PHP Mailto(); The Natural Philosopher <tnp@invalid.invalid> - 2013-07-01 14:09 +0100
    Re: PHP Mailto(); Twayne <nobody@spamcop.net> - 2013-07-01 10:10 -0400
      Re: PHP Mailto(); Tim Streater <timstreater@greenbee.net> - 2013-07-01 16:34 +0100
        Re: PHP Mailto(); The Natural Philosopher <tnp@invalid.invalid> - 2013-07-01 16:58 +0100
          Re: PHP Mailto(); Tim Streater <timstreater@greenbee.net> - 2013-07-01 18:24 +0100
            Re: PHP Mailto(); The Natural Philosopher <tnp@invalid.invalid> - 2013-07-01 18:47 +0100
              Re: PHP Mailto(); Tim Streater <timstreater@greenbee.net> - 2013-07-01 20:43 +0100
        Re: PHP Mailto(); "J.O. Aho" <user@example.net> - 2013-07-01 19:05 +0200
          Re: PHP Mailto(); Christoph Michael Becker <cmbecker69@arcor.de> - 2013-07-01 19:21 +0200
            Re: PHP Mailto(); "J.O. Aho" <user@example.net> - 2013-07-01 19:30 +0200

csiph-web