Current location: Hot Scripts Forums » Programming Languages » PHP » problem with mail()


problem with mail()

Reply
  #1 (permalink)  
Old 05-24-05, 10:52 AM
nfinity8 nfinity8 is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
problem with mail()

I am sending a mail through php with mail() like this:

mail("email@desinator.com",
"Subject",
"Here is the mail:".$message
);

And $message is containig the message that I want to send to the destinator(the mail should begin with: "Here is the mail:") and has previsouly been entered via a textarea.

So far almost everything is working. There is just one problem with some characters.

Problem character -> are replaced by ... when arriving as email

‘ -> '
! -> !
$ -> $
“ -> "
< -> &lt;

For example when $message contains:
Hello !
The person gets:
Hello !

If I give $message out with echo; before sending, than the message appreas correctly on screen.

What do I have to do ?
I tried addslashes(); but it doesn't seem to change anything?

Thanks for helping !
Reply With Quote
  #2 (permalink)  
Old 05-24-05, 11:56 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by nfinity8
For example when $message contains:
Hello !
The person gets:
Hello !
um... ok unless im blind I cant see the problem
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
  #3 (permalink)  
Old 05-24-05, 12:33 PM
nfinity8 nfinity8 is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
oh, it seems that vBulletin software converted this string to !

I didn't wrote "!" but "&#33 ;" (without the space, I put that now so that I don't get converted by vBulletin)

here are the other examples

‘ -> &#39 ;
! -> &#33 ;
$ -> &#36 ;
“ -> &quot ;
< -> &lt ;

[Test to see if I am right: ! <- this was &#33 ; without the space before ";"]
Reply With Quote
  #4 (permalink)  
Old 05-24-05, 02:42 PM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
if ur trying to send a html email then thats not the right way anyway
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
  #5 (permalink)  
Old 05-25-05, 02:55 AM
nfinity8 nfinity8 is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
mail() is php command ... isn't it ?

What is the right command for my task then ?

Can no one help me ?
Reply With Quote
  #6 (permalink)  
Old 05-25-05, 08:06 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
ARE YOU TRYING TO SEND AN HTML EMAIL - YES OR NO?

then we can help you
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
  #7 (permalink)  
Old 05-25-05, 09:36 AM
handry handry is offline
Newbie Coder
 
Join Date: Oct 2004
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Problem with your mail

May be you should tell us that you already know between char placement in PHP and HTML...

I assume that you know PHP coding style and work..
__________________
50Mb PHP+MySQL FREE Web Hosting and Techindo Affordable Prices Hosting
(Fantastico(20+ top scripts), Live Support 24/7, Uptime 99,99%, cPanel)

Internet Marketing Strategy and Online Business Strategy Resources
Reply With Quote
  #8 (permalink)  
Old 05-25-05, 10:09 AM
nfinity8 nfinity8 is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by FiRe
ARE YOU TRYING TO SEND AN HTML EMAIL - YES OR NO?

then we can help you
Oh, you mean if the email-content contains HTML ?
No, the message is just normal text. No HTML in the message to send.

Sorry I just didn't undestand the question correctly.

Thanks !

Last edited by nfinity8; 05-25-05 at 10:11 AM.
Reply With Quote
  #9 (permalink)  
Old 05-25-05, 11:01 AM
FiRe FiRe is offline
Code Guru
 
Join Date: Oct 2004
Location: UK
Posts: 801
Thanks: 0
Thanked 0 Times in 0 Posts
so when u put "<" in the message u are actually seeing the chr "&lt;" ??
__________________
Alexa Share <-- Trade virtual shares in websites with this online game.

codR.us <-- Submit and vote for your favorite code snippets with codR.us.

XEWeb.net <-- The ultimate PHP resource network.
Reply With Quote
  #10 (permalink)  
Old 05-25-05, 02:54 PM
nfinity8 nfinity8 is offline
Newbie Coder
 
Join Date: Mar 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by FiRe
so when u put "<" in the message u are actually seeing the chr "&lt;" ??
Yes, I receive "&lt;" when reading my email.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail problem boxkites PHP 2 01-11-06 09:56 PM
Upload Script Problem!!! seanknighton Perl 0 03-21-04 09:54 PM
send mail problem jilshi JavaScript 0 03-01-04 09:48 PM
(Problem) PLESK, DNS and a remote mailserver FunkyM The Lounge 0 10-02-03 04:28 PM


All times are GMT -5. The time now is 06:46 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.