Slashes in emails?

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

mako1200
New php-forum User
New php-forum User
Posts: 4
Joined: Tue Oct 08, 2002 12:06 am

Slashes in emails?

Postby mako1200 » Tue Oct 08, 2002 1:10 pm

Ok.....I have a new question...

When I send a email using the mail() function, anytime there is a apostrophe, it is sent with an escape character:

isn't --> isn\'t

Is there something I need to do before the email is sent to prevent this? Or does this depend on the mail application the server is using?

--MaKO

DoppyNL

Postby DoppyNL » Tue Oct 08, 2002 1:28 pm

you can strip the slashes of the contents with the function stripslashes

Greetz Daan

mako1200
New php-forum User
New php-forum User
Posts: 4
Joined: Tue Oct 08, 2002 12:06 am

Thats what I was thinking...

Postby mako1200 » Tue Oct 08, 2002 6:44 pm

I thought about using that too.....but what if the email acutally contained legit slash characters?

Thanks for your help, Doppy...=>

--MaKO

DoppyNL

Postby DoppyNL » Tue Oct 08, 2002 10:52 pm

That function will only remove slashes that are used to escape characters that come after it.
If there is another character it will not be removed.

Another point, if you're message is filled with slashes, then somehow php has run addslashes on it, so you can undo that with stripslashes.

Greetz Daan


Return to “PHP coding => General”

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron