FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP Mailto();
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: PHP Mailto(); [message #182056 is a reply to message #182054] Mon, 01 July 2013 15:28 Go to previous messageGo to previous message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma:
Senior Member
In article <kqs3dn$2s7$1(at)speranza(dot)aioe(dot)org>,
Twayne <nobody(at)spamcop(dot)net> wrote:

> 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.

Since the standards specify CRLF I do this:

$lf = chr (10);
$cr = chr (13);
$nl = $cr . $lf;

and use $nl throughout.

You might also want to snoop on your traffic to see what gets sent. I
use PacketPeeper for this.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: DIY finger tip typin - pace and code, (PHP open source)
Next Topic: tracking IP's
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Thu Jan 30 16:02:12 GMT 2025

Total time taken to generate the page: 0.04729 seconds