Jump to content

Is there a way to prevent automatic URL creation in mail client?


Recommended Posts

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

 

 

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.

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.