|
 |
|
 |
05-07-2008, 02:59 AM
|
#1 (permalink)
|
|
Recruit
Join Date: May 2008
Posts: 19
|
mailing problem
Hi everybody,
I have wrote a php script to send a mail. It works fine with the mail id's of google,yahoo,rediff,... but it is not working for mail id of my company. Code reads as follows:
<?php
$to = 'maheshkumar.davuluri@bipsum.com';
$subject = $_POST['txtSub'];
$name = $_POST['txtName'];
$com = $_POST['txtCom'];
$email= $_POST['txtEmail'];
$city = $_POST['txtCity'];
$con = $_POST['txtContry'];
$ph1 = $_POST['txtPh1'];
$ph2 = $_POST['txtPh2'];
$comm = $_POST['txtAr'];
$message = "---------------------------\n".
"----Sender's detail's------\n".
"Name of the Sender : $name\n".
"Company Name : $com\n".
"Email Id is : $email\n".
"City : $city\n".
"Country : $con\n".
"Contact number : code-$ph1 , number-$ph2\n".
"-----Comment's------------\n".
"$comm\n".
"--------------------------\n";
mail($to,$subject,$message,$headers);
header("Location:http://www.bipsum.com/thankyou.html");
exit;?>
i'm wondering for so many days why it is not working. Any help is appreciated.
thanks in advance.
|
|
|
05-07-2008, 03:11 PM
|
#2 (permalink)
|
|
Java fanboy
Join Date: Aug 2003
Posts: 1,139
|
You don't define '$headers' in the code snippet you posted. Your company's e-mail server might not accept mail unless the 'From' field (which is defined in '$headers') is filled out.
|
|
|
05-07-2008, 09:42 PM
|
#3 (permalink)
|
|
Recruit
Join Date: May 2008
Posts: 19
|
Re: mailing problem
hi,
i still cant get the email even mail is going porperly. any suggestions please.
thanks
|
|
|
05-08-2008, 01:54 AM
|
#4 (permalink)
|
|
Java fanboy
Join Date: Aug 2003
Posts: 1,139
|
Quote:
Thanks for your reply. I have tried with the following code with the corrections that you have suggested:
<?php
$to = 'maheshkumar.davuluri@bipsum.com';
$subject = $_POST['txtSub'];
$name = $_POST['txtName'];
$com = $_POST['txtCom'];
$email= $_POST['txtEmail'];
$city = $_POST['txtCity'];
$con = $_POST['txtContry'];
$ph1 = $_POST['txtPh1'];
$ph2 = $_POST['txtPh2'];
$comm = $_POST['txtAr'];
$headers = "From: maheshkumar.davuluri@gmail.com\r\n";
$message = "---------------------------\n".
"----Sender's detail's------\n".
"Name of the Sender : $name\n".
"Company Name : $com\n".
"Email Id is : $email\n".
"City : $city\n".
"Country : $con\n".
"Contact number : code-$ph1 , number-$ph2\n".
"-----Comment's------------\n".
"$comm\n".
"--------------------------\n";
mail($to,$subject,$message,$headers);
header("Location:http://www.bipsum.com/thankyou.html");
exit;?>
now mail delivery is fine but it is not appearing in the inbox at the destination. Please help me in this regard
thanks
|
How do you know that delivery works if it's not showing up in your inbox?
Are you sure you're sending it to the correct address?
P.S. - Please keep the conversation in the forums.
|
|
|
05-08-2008, 03:06 AM
|
#5 (permalink)
|
|
Recruit
Join Date: May 2008
Posts: 19
|
thak you url that i have place in the header location is loading successfully, and also i have checked it by assigning a variable. like checking weather it returns true or false. coz mail() returns a boolean value. If there is any alternative please suggest me if not this porgraming.
thanks
|
|
|
05-08-2008, 08:57 AM
|
#6 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,444
|
are you saying it's not able to send email to your company, but it is working for other email addresses? if so, it's probably triggering a spam filter on your company's mail server.
__________________
Mike
|
|
|
05-08-2008, 11:47 PM
|
#7 (permalink)
|
|
Recruit
Join Date: May 2008
Posts: 19
|
actually the problem is that it is neither going in to inbox nor appearing in the spam of my company email-id. please any one specify me another programing alternative in php if it is not the right one.
|
|
|
05-09-2008, 08:51 AM
|
#8 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,444
|
ok, have you verified your php.ini file is pointing to the proper mail executable or mail server? the area in the file looks like this, but you would need to un-comment one of the lines and set the value depending on your os and mail method
Code:
[mail function]
; For Win32 only.
;SMTP =
; For Win32 only.
;sendmail_from =
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = "sendmail -t -i"
__________________
Mike
|
|
|
05-09-2008, 11:17 PM
|
#9 (permalink)
|
|
Recruit
Join Date: May 2008
Posts: 19
|
mailing problem
hi sde and every body,
i have to upload the code to 'ftp' from there i need to monitor the transaction of the mail. Therefore i think there is no need to worry about the php.ini file. If any body want to check php of my company server go to this link: phpinfo()
thanks
|
|
|
05-09-2008, 11:44 PM
|
#10 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,444
|
try to simplify your script. here's a sample taken from php.net. if this doesn't work for you, i don't know how to help.
PHP Code:
<?php mail('caffinated@example.com', 'My Subject', $message);
PHP: mail - Manual
__________________
Mike
|
|
|
05-10-2008, 12:57 AM
|
#11 (permalink)
|
|
Moderator
Join Date: May 2002
Location: us.ca
Posts: 4,444
|
also, please refrain from contacting me outside this thread. i get notifications when it updates. thanks.
__________________
Mike
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -8. The time now is 04:38 PM.
|
Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting
|
 |
|