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.
<?php
$name = $_POST[name];
$email = $_POST[email];
$subject = $_POST[subject];
$company = $_POST[company];
$message = $_POST[message];
$from = "email id from which the email would be sent";
$mail_header = 'MIME-Version: 1.0'."\r\n";
$mail_header .= 'Content-Type: text/html; charset = iso-8859-1'."\r\n";
$mail_header .= 'From:'.$from;
$to = 'email id to be sent';
$email_subject = $subject;
$email_message = $message;
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.
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
hello,
Praty, This's my new proj.
Here I'll develop different web projects.
Thanks & Regards
P's P
After using nl2br() I am getting following result
Code:
hello,
Praty, This's my new proj.
Here I'll develop different web projects.
Thanks & Regards
P's P
You can mark I have given a white space before Praty which is not reflected in the result.
Bookmarks