By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,453 Members | 956 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,453 IT Pros & Developers. It's quick & easy.

Sending a mail using php

P: 21
Hi all,
I am new to php, I want to sent mail using php. What are the pre-settings that I am supposed to do. Please help me out.

With regards,
kumuda
Aug 9 '07 #1
Share this Question
Share on Google+
7 Replies


P: 1
just use mail function of php to send a mail.

You can get details regarding this function on this link
http://in2.php.net/manual/en/ref.mail.php

basic steps are,
- setup smtp server in your php.ini if not set and restart your webserver
- setup mail parameters in your php program and run
Aug 9 '07 #2

ak1dnar
Expert 100+
P: 1,584
Hi there,
Both are welcome to TSDN ! Stay in touch !
-ajaxrand
Aug 9 '07 #3

P: 21
Thank u for the reply. I will try it out.

just use mail function of php to send a mail.

You can get details regarding this function on this link
http://in2.php.net/manual/en/ref.mail.php

basic steps are,
- setup smtp server in your php.ini if not set and restart your webserver
- setup mail parameters in your php program and run
Aug 10 '07 #4

ak1dnar
Expert 100+
P: 1,584
Thank u for the reply. I will try it out.
If there is a problem with your coding, post back the errors and coding snippets back to the thread.
good luck!
Aug 10 '07 #5

P: 21
HI
I made the changes as given in the table of this link http://in2.php.net/manual/en/ref.mail.php and what are the other changes I am supposed to do. Please help me out.

Thanks


just use mail function of php to send a mail.

You can get details regarding this function on this link
http://in2.php.net/manual/en/ref.mail.php

basic steps are,
- setup smtp server in your php.ini if not set and restart your webserver
- setup mail parameters in your php program and run
Aug 10 '07 #6

realin
100+
P: 254
Now try to send youself a simple email, to start with and to check if the settings are working correctly..

[php]
<?php
$to=youremail@domain.com
$subject="hi this is my first email";
$msg="this is the body of the email";

$sent=mail($to,$subject,$msg);

if($sent)
echo "mail was sent to $to";
else
echo "ERROR: sending the mail";
?>[/php]

yuo can paste the code after making the necessary changes :)
Aug 10 '07 #7

ak1dnar
Expert 100+
P: 1,584
Now try to send youself a simple email, to start with and to check if the settings are working correctly..

[php]
<?php
$to=youremail@domain.com
$subject="hi this is my first email";
$msg="this is the body of the email";

$sent=mail($to,$subject,$msg);

if($sent)
echo "mail was sent to $to";
else
echo "ERROR: sending the mail";
?>[/php]

yuo can paste the code after making the necessary changes :)
Try isset() function for :

Expand|Select|Wrap|Line Numbers
  1.  if(isset($sent)){
  2.  
  3. }else{
  4.  
  5. }
Aug 10 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.