ashish2k
asked on
Sending email
Hi Friends
I am using Php on NT server with Apache. When I try to send email using the following command
mail("ashish@hotmail.com", "Test subject line ", "Test body of email", "From: ashish@expo.com\n")
It was giving the following error :-
Failed to connect
then I downloaded one s/w called ftgate then after installing that the error changed to :-
Warning: Failed to Receive in e:\php_workarea\jayesh\php _project\c oemail.php on line 2
Fatal error: Maximum execution time of 30 seconds exceeded in e:\php_workarea\jayesh\php _project\c oemail.php on line 3
Can anyone tell me how to send mail and give the full coding currently I am using the following mail program :-
<?php
if(mail("ashish@hotmail.co m", "Test subject line ", "Test body of email", "From: ashish@expo.com\n"))
{
print('mail successfully sent');
}
else
{
// print('oops! something didn't work right above, check the syntax of your code');
}
?>
Bye
Waiting for your replies,
Ashish
I am using Php on NT server with Apache. When I try to send email using the following command
mail("ashish@hotmail.com",
It was giving the following error :-
Failed to connect
then I downloaded one s/w called ftgate then after installing that the error changed to :-
Warning: Failed to Receive in e:\php_workarea\jayesh\php
Fatal error: Maximum execution time of 30 seconds exceeded in e:\php_workarea\jayesh\php
Can anyone tell me how to send mail and give the full coding currently I am using the following mail program :-
<?php
if(mail("ashish@hotmail.co
{
print('mail successfully sent');
}
else
{
// print('oops! something didn't work right above, check the syntax of your code');
}
?>
Bye
Waiting for your replies,
Ashish
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
It means that you send something to the browser before sending header:
print "hello";
session_start();
won't work and you will get a warning
print "hello";
session_start();
won't work and you will get a warning
ASKER
Hi us111
You are right if I right something before session_start(); then it prints hello but after that gives the same two warnings I had told you before. Please tell me how can I remove these warnings and how can I create session variables in PHP.
Warning: Cannot send session cookie - headers already sent by (output started at e:\php_workarea\jayesh\php _project\l oginnow.ph p:3)
in e:\php_workarea\jayesh\php _project\l oginnow.ph p on line 29
Warning: Cannot send session cache limiter - headers already sent (output started at e:\php_workarea\jayesh\php _project\l oginnow.ph p:3)
in e:\php_workarea\jayesh\php _project\l oginnow.ph p on line 29
Wherever in my code I right session_start(); the error comes in that line, in this case I have written in line 29. Can you please tell me a way whereby I can remove this error. Please also tell whether I have to make some changes in php.ini file or not.
Thanking you in advance
Bye
Waiting for your reply.
Ashish
You are right if I right something before session_start(); then it prints hello but after that gives the same two warnings I had told you before. Please tell me how can I remove these warnings and how can I create session variables in PHP.
Warning: Cannot send session cookie - headers already sent by (output started at e:\php_workarea\jayesh\php
in e:\php_workarea\jayesh\php
Warning: Cannot send session cache limiter - headers already sent (output started at e:\php_workarea\jayesh\php
in e:\php_workarea\jayesh\php
Wherever in my code I right session_start(); the error comes in that line, in this case I have written in line 29. Can you please tell me a way whereby I can remove this error. Please also tell whether I have to make some changes in php.ini file or not.
Thanking you in advance
Bye
Waiting for your reply.
Ashish
ASKER
Warning: Cannot send session cookie - headers already sent by (output started at e:\php_workarea\jayesh\php
Warning: Cannot send session cache limiter - headers already sent (output started at e:\php_workarea\jayesh\php
For this do I have to do some changes in php.ini only or something please let me know I will be very thankful to you but this session_start() is working in a new file.
Bye
Thanks