Dear all this is my first post in a forum. So I don't know if I am post at the right place or not.
Anyway my problem is regarding email. I send the form fields through the mail() function. But the email reaches from someone named ipg.abhisekasahucom@boscgi3402.eigbox.net

I want to change this address to something my personal, like , me@mydomain.com

I am sure it can be done but dont know how to do this. Please reply soon.

Thanks a lot Pactor21 for your solution. My main problem resolved. Now the 2nd problem is the mail which I get is little deformed. The special characters like ', '' are followed by an \ .
Why am I not getting the mail as it is? Another thing is the new line i.e when I press enter button in the text area it is not shown in the mail.

10-11-2011, 02:42 AM

pactor21

In order to determine what's causing the problem, I need to see your PHP file sending emails.

Thanks pactor for your help. the stripslashes() worked very well. But the problem is when someone presses the "enter" key then in the mail a new line should start, but in my case it's not creating a new line.

10-14-2011, 04:12 AM

pactor21

Try this then.

Code:

$message=nl2br(stripslashes($message));

10-14-2011, 10:19 AM

Praty888

yes. the nl2br() worked. But why such type of problems occur with mail() ? Till now following problems have been encountered.
1. The quotes are not escaped rather a backward slash "\" is encountered. This is rectified by adding stripslashes(). One thing I should mention that i am not getting the "\"s while testing on my local machine, wamp server. But in Ipage's server I am getting the "\".

2. The new line character or the <br> is not executed. This is rectified by using nl2br(). Though nl2br() is not the perfect one. When following text is sent through the form mail