SpankMarvin Posted October 10, 2009 Share Posted October 10, 2009 Hi there I am making a mail script from a contact form, part of which I am pasting below. The problem I am having is in the use of .com in a name. When I view the email in a client, it seems to be turning the name into a URL automatically. Is there something in my code which could force this to remain as plain text? I'm using the mail(); function with the message variable defined as follows. The otehr variables are defined in the code beforehand. The troublesome text is the .com text... $email_msg = "New message submitted from Media PowerTools.com:\n\n Name: ".$name."\n\n Email: ".$email."\n\n Message:\n". $msg . "\n"; Any pointers would be useful. It's only an irritation but I'd like to get to the bottom of it! Thanks J Quote Link to comment https://forums.phpfreaks.com/topic/177239-is-there-a-way-to-prevent-automatic-url-creation-in-mail-client/ Share on other sites More sharing options...
mikesta707 Posted October 10, 2009 Share Posted October 10, 2009 I'm not sure, but I think that depends on the email client, rather than the script itself. but is your email a plain text email or an html email? setting it as plain text might fix the problem Quote Link to comment https://forums.phpfreaks.com/topic/177239-is-there-a-way-to-prevent-automatic-url-creation-in-mail-client/#findComment-934533 Share on other sites More sharing options...
.josh Posted October 10, 2009 Share Posted October 10, 2009 you can try using htmlentities on the string but dunno whether that will work for emails or not. Quote Link to comment https://forums.phpfreaks.com/topic/177239-is-there-a-way-to-prevent-automatic-url-creation-in-mail-client/#findComment-934537 Share on other sites More sharing options...
.josh Posted October 10, 2009 Share Posted October 10, 2009 actually my bad, I don't think htmlentities() covers dots. Try using . instead of the dot. Quote Link to comment https://forums.phpfreaks.com/topic/177239-is-there-a-way-to-prevent-automatic-url-creation-in-mail-client/#findComment-934539 Share on other sites More sharing options...
SpankMarvin Posted October 10, 2009 Author Share Posted October 10, 2009 actually my bad, I don't think htmlentities() covers dots. Try using . instead of the dot. Thank you for the responses! It tried this, and unfortunately it renders the . as the entity code. I tried adding html_entity_decode() but this returned me to my original issue! Hmm... thank you for your input though. Quote Link to comment https://forums.phpfreaks.com/topic/177239-is-there-a-way-to-prevent-automatic-url-creation-in-mail-client/#findComment-934544 Share on other sites More sharing options...
mikesta707 Posted October 10, 2009 Share Posted October 10, 2009 is your email set as a plain text email? If so I think that it probably has something to do with the email client itself. try opening the email in different email clients and see if you have the same problem Quote Link to comment https://forums.phpfreaks.com/topic/177239-is-there-a-way-to-prevent-automatic-url-creation-in-mail-client/#findComment-934547 Share on other sites More sharing options...
.josh Posted October 10, 2009 Share Posted October 10, 2009 well you could always explore other alternatives. Removing the .com, changing the . to "dot" something.com to something or something dot com Quote Link to comment https://forums.phpfreaks.com/topic/177239-is-there-a-way-to-prevent-automatic-url-creation-in-mail-client/#findComment-934557 Share on other sites More sharing options...
SpankMarvin Posted October 10, 2009 Author Share Posted October 10, 2009 is your email set as a plain text email? If so I think that it probably has something to do with the email client itself. try opening the email in different email clients and see if you have the same problem I am trying that now, but (gulp) seem to be failing. I added a content type header as follows: $headers .= "Content-type: text/plain; charset=iso-8859-1\r\n"; but now the email will not send. I am positive I am missing something on the headers that is causing this new problem. Any ideas? Re the . vs "dot" solution. I needn't have the dot at all, to be honest. I was just interested in working out a solution, if there is one, for, err, 'fun', or something... Thanks J Quote Link to comment https://forums.phpfreaks.com/topic/177239-is-there-a-way-to-prevent-automatic-url-creation-in-mail-client/#findComment-934564 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.