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

Home » Imported messages » comp.lang.php » php mail( )
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
php mail( ) [message #171222] Wed, 29 December 2010 17:12 Go to next message
me is currently offline  me
Messages: 192
Registered: September 2010
Karma: 0
Senior Member
This code appears in a mail( ) script that sends me notice of errors.

$message .= "User Email: $erruseremail"."?Subject=Blah Blah Blah"."\r\n\n";

When the email arrives it looks like this:

User Email: me(at)example(dot)com?Subject=Blah Blah Blah but with the
underlying mailto link of only me(at)example(dot)com?Subject=Blah (just a part
of the Subject string).

If I change the code to $message .= "User Email:
$erruseremail"."?Subject=BlahBlahBlah"."\r\n\n"; (remove all spaces in
the subject string) the email arrives as expected, with the mailto link
including the entire subject string.

I have tried every combination of the use of double and single quotes I
can think of with no joy. Where am I missing the boat?

Many thanks,

Bill B
Re: php mail( ) [message #171226 is a reply to message #171222] Wed, 29 December 2010 17:55 Go to previous messageGo to next message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
El 29/12/2010 18:12, Bill Braun escribió/wrote:
> This code appears in a mail( ) script that sends me notice of errors.
>
> $message .= "User Email: $erruseremail"."?Subject=Blah Blah Blah"."\r\n\n";
>
> When the email arrives it looks like this:
>
> User Email: me(at)example(dot)com?Subject=Blah Blah Blah but with the
> underlying mailto link of only me(at)example(dot)com?Subject=Blah (just a part
> of the Subject string).
>
> If I change the code to $message .= "User Email:
> $erruseremail"."?Subject=BlahBlahBlah"."\r\n\n"; (remove all spaces in
> the subject string) the email arrives as expected, with the mailto link
> including the entire subject string.
>
> I have tried every combination of the use of double and single quotes I
> can think of with no joy. Where am I missing the boat?

If I understood correctly, you want to send an e-mail address in plain
text in such a way that e-mail clients are able to find it and generate
a proper HTML tag with a mailto link and a correct subject parameter.

I don't think it's even worth trying. There're thousands of different
link parsers out there and you have no control over them. It's way
simplier to just send an a message in HTML format and provide the exact
markup you want to use.

You can send HTML messages with mail() but it's probably easier to fetch
PhpMailer or another similar third-party tool.


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
Re: php mail( ) [message #171228 is a reply to message #171226] Wed, 29 December 2010 18:14 Go to previous messageGo to next message
me is currently offline  me
Messages: 192
Registered: September 2010
Karma: 0
Senior Member
On 12/29/2010 12:55 PM, "Álvaro G. Vicario" wrote:
> El 29/12/2010 18:12, Bill Braun escribió/wrote:
>> This code appears in a mail( ) script that sends me notice of errors.
>>
>> $message .= "User Email: $erruseremail"."?Subject=Blah Blah
>> Blah"."\r\n\n";
>>
>> When the email arrives it looks like this:
>>
>> User Email: me(at)example(dot)com?Subject=Blah Blah Blah but with the
>> underlying mailto link of only me(at)example(dot)com?Subject=Blah (just a part
>> of the Subject string).
>>
>> If I change the code to $message .= "User Email:
>> $erruseremail"."?Subject=BlahBlahBlah"."\r\n\n"; (remove all spaces in
>> the subject string) the email arrives as expected, with the mailto link
>> including the entire subject string.
>>
>> I have tried every combination of the use of double and single quotes I
>> can think of with no joy. Where am I missing the boat?
>
> If I understood correctly, you want to send an e-mail address in plain
> text in such a way that e-mail clients are able to find it and generate
> a proper HTML tag with a mailto link and a correct subject parameter.
>
> I don't think it's even worth trying. There're thousands of different
> link parsers out there and you have no control over them. It's way
> simplier to just send an a message in HTML format and provide the exact
> markup you want to use.
>
> You can send HTML messages with mail() but it's probably easier to fetch
> PhpMailer or another similar third-party tool.
>
>

Thank you, Alvaro. After flailing away at it for some time, I am no
further along that when I started. I'll follow your suggestion.

Bill B
Re: php mail( ) [message #171287 is a reply to message #171222] Thu, 30 December 2010 01:37 Go to previous messageGo to next message
Kim Andr Aker is currently offline  Kim Andr Aker
Messages: 17
Registered: September 2010
Karma: 0
Junior Member
På Wed, 29 Dec 2010 18:12:37 +0100, skrev Bill Braun <me(at)privacy(dot)net>:

> This code appears in a mail( ) script that sends me notice of errors.
>
> $message .= "User Email: $erruseremail"."?Subject=Blah Blah
> Blah"."\r\n\n";
>
> When the email arrives it looks like this:
>
> User Email: me(at)example(dot)com?Subject=Blah Blah Blah but with the
> underlying mailto link of only me(at)example(dot)com?Subject=Blah (just a part
> of the Subject string).
>
> If I change the code to $message .= "User Email:
> $erruseremail"."?Subject=BlahBlahBlah"."\r\n\n"; (remove all spaces in
> the subject string) the email arrives as expected, with the mailto link
> including the entire subject string.
>
> I have tried every combination of the use of double and single quotes I
> can think of with no joy. Where am I missing the boat?

If you're expecting your e-mail client to convert the whole thing to a
mailto-link, I suggest encoding the subject text with urlencode().
http://php.net/urlencode

--
Kim André Akerø
- kimandre(at)NOSPAMbetadome(dot)com
(remove NOSPAM to contact me directly)
Re: php mail( ) [message #171288 is a reply to message #171287] Thu, 30 December 2010 01:39 Go to previous messageGo to next message
me is currently offline  me
Messages: 192
Registered: September 2010
Karma: 0
Senior Member
On 12/29/2010 8:37 PM, Kim André Akerø wrote:
> På Wed, 29 Dec 2010 18:12:37 +0100, skrev Bill Braun <me(at)privacy(dot)net>:
>
>> This code appears in a mail( ) script that sends me notice of errors.
>>
>> $message .= "User Email: $erruseremail"."?Subject=Blah Blah
>> Blah"."\r\n\n";
>>
>> When the email arrives it looks like this:
>>
>> User Email: me(at)example(dot)com?Subject=Blah Blah Blah but with the
>> underlying mailto link of only me(at)example(dot)com?Subject=Blah (just a
>> part of the Subject string).
>>
>> If I change the code to $message .= "User Email:
>> $erruseremail"."?Subject=BlahBlahBlah"."\r\n\n"; (remove all spaces in
>> the subject string) the email arrives as expected, with the mailto
>> link including the entire subject string.
>>
>> I have tried every combination of the use of double and single quotes
>> I can think of with no joy. Where am I missing the boat?
>
> If you're expecting your e-mail client to convert the whole thing to a
> mailto-link, I suggest encoding the subject text with urlencode().
> http://php.net/urlencode
>

Many, many thanks. I had forgotten about that.

Bill B
Re: php mail( ) [message #171305 is a reply to message #171228] Thu, 30 December 2010 08:40 Go to previous messageGo to next message
alvaro.NOSPAMTHANX is currently offline  alvaro.NOSPAMTHANX
Messages: 277
Registered: September 2010
Karma: 0
Senior Member
El 29/12/2010 19:14, Bill Braun escribió/wrote:
> Thank you, Alvaro. After flailing away at it for some time, I am no
> further along that when I started. I'll follow your suggestion.

I have the impression that you didn't really understand me...

What I meant is that there is text plain:

Contact me at webmaster(at)example(dot)com for further info

.... and there is HTML:

<p>Contact me at <a
href="mailto:webmaster(at)example(dot)com">webmaster(at)example(dot)com</a> for
further info</p>

In text plain messages, you should not be able to click on an e-mail
addresss. However, you can _normally_ do it because Thunderbird,
Outlook, Gmail and Yahoo are so smart that try to figure out what looks
like an e-mail address. But it's not something *you* do when you compose
the message.

In HTML messages it's *you* the one that says "_this_ is an e-mail
address" by using the appropriate HTML tags.


--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
Re: php mail( ) [message #171317 is a reply to message #171305] Thu, 30 December 2010 09:41 Go to previous message
me is currently offline  me
Messages: 192
Registered: September 2010
Karma: 0
Senior Member
On 12/30/2010 3:40 AM, "Álvaro G. Vicario" wrote:
> El 29/12/2010 19:14, Bill Braun escribió/wrote:
>> Thank you, Alvaro. After flailing away at it for some time, I am no
>> further along that when I started. I'll follow your suggestion.
>
> I have the impression that you didn't really understand me...
>
> What I meant is that there is text plain:
>
> Contact me at webmaster(at)example(dot)com for further info
>
> .... and there is HTML:
>
> <p>Contact me at <a
> href="mailto:webmaster(at)example(dot)com">webmaster(at)example(dot)com</a> for
> further info</p>
>
> In text plain messages, you should not be able to click on an e-mail
> addresss. However, you can _normally_ do it because Thunderbird,
> Outlook, Gmail and Yahoo are so smart that try to figure out what looks
> like an e-mail address. But it's not something *you* do when you compose
> the message.
>
> In HTML messages it's *you* the one that says "_this_ is an e-mail
> address" by using the appropriate HTML tags.
>
>

You are right. I missed your larger point, but understand it better now.
Thank you for the follow-up.

Bill B
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Open Session Variables
Next Topic: Value in a grid
Goto Forum:
  

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

Current Time: Fri Sep 20 14:52:36 GMT 2024

Total time taken to generate the page: 0.02941 seconds