 |
04-10-2011, 10:12 AM
|
#1 (permalink)
|
|
learn more share more....
Join Date: May 2011
Posts: 36
|
send mails using php
i need to send mails using php.how do i do that?
|
|
|
|
Advertisements. Register and be a member of the community to get rid of them.
|
|
Advertisement
|
|
04-10-2011, 12:18 PM
|
#2 (permalink)
|
|
Simply a DIGITian
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
|
Re: send mails using php
A simple google search would have revealed that.
Check PHP Mail for the idea.
And for more detail check PHP: mail - Manual
__________________
- Read The Forum RULES First.
- Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
- Before Starting A New Thread Read The STICKY THREADS First
- Before Participating In Bazaar Section Read The BAZAAR RULES
|
|
|
04-10-2011, 12:26 PM
|
#3 (permalink)
|
|
learn more share more....
Join Date: May 2011
Posts: 36
|
Re: send mails using php
i have read all those but dat doesnt seem to work.
|
|
|
04-10-2011, 12:31 PM
|
#4 (permalink)
|
|
Simply a DIGITian
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
|
Re: send mails using php
Ya, those works perfectly fine, check Spam mails, as you don't have proper header it may get into spam.
__________________
- Read The Forum RULES First.
- Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
- Before Starting A New Thread Read The STICKY THREADS First
- Before Participating In Bazaar Section Read The BAZAAR RULES
|
|
|
04-10-2011, 12:39 PM
|
#5 (permalink)
|
|
learn more share more....
Join Date: May 2011
Posts: 36
|
Re: send mails using php
ya checked but doesnt work...any other possibilities?
|
|
|
04-10-2011, 12:45 PM
|
#6 (permalink)
|
|
Simply a DIGITian
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
|
Re: send mails using php
Are you sure..
Code:
<?php
$to = "someone@example.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
this program is not working??
It's working fine for me. Are you on Linux or using XAMPP / WAMP??
__________________
- Read The Forum RULES First.
- Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
- Before Starting A New Thread Read The STICKY THREADS First
- Before Participating In Bazaar Section Read The BAZAAR RULES
|
|
|
04-10-2011, 12:47 PM
|
#7 (permalink)
|
|
learn more share more....
Join Date: May 2011
Posts: 36
|
Re: send mails using php
am using wamp...and should i download any smtp server fr dat?
|
|
|
04-10-2011, 12:51 PM
|
#8 (permalink)
|
|
Simply a DIGITian
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
|
Re: send mails using php
Nope, that should work fine. Don't know if there is any issue with WAMP itself.
I'd recommend to try XAMPP once if possible.
Otherwise you can use PHP Pear Mail package for SMTP Mail.
__________________
- Read The Forum RULES First.
- Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
- Before Starting A New Thread Read The STICKY THREADS First
- Before Participating In Bazaar Section Read The BAZAAR RULES
|
|
|
04-10-2011, 01:04 PM
|
#9 (permalink)
|
|
learn more share more....
Join Date: May 2011
Posts: 36
|
Re: send mails using php
ok...ll do dat and let u knw....
in xampp it says "Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\mailf.php on line 7"
and on welcome page,der is a "status" option on right.in dat it says "SMTP service deactivated".has dis got to do anythng wid my problem?
|
|
|
04-10-2011, 01:09 PM
|
#10 (permalink)
|
|
Simply a DIGITian
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
|
Re: send mails using php
Can you please post your code??
Looks like you are not trying to send mails through internet instead you are trying to send mails through your mail server. Else WTH mail() will try to find SMTP Server on localhost.
__________________
- Read The Forum RULES First.
- Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
- Before Starting A New Thread Read The STICKY THREADS First
- Before Participating In Bazaar Section Read The BAZAAR RULES
|
|
|
04-10-2011, 01:14 PM
|
#11 (permalink)
|
|
learn more share more....
Join Date: May 2011
Posts: 36
|
Re: send mails using php
<?php
$to = "hackpca@gmail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "urpcissafe@gmail.com";
$headers = "From:" . $from;
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
|
|
|
04-10-2011, 01:23 PM
|
#12 (permalink)
|
|
Simply a DIGITian
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
|
Re: send mails using php
Check How to use sendmail in XAMPP for Windows | i.justrealized and try to add your mail id and password there from which you'd like to send the mail.
BTW that script has worked for me before without all these. Don't know if I'm also missing something.
Ahh figured it out I never did this from desktop. The mails scripts I've developed before was tried and tested on the server itself.
So you need to do that setting in php.ini as you need a authenticating SMTP server from which the mail will be sent. So that's must.
You can do the same in WAMP too.
__________________
- Read The Forum RULES First.
- Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
- Before Starting A New Thread Read The STICKY THREADS First
- Before Participating In Bazaar Section Read The BAZAAR RULES
|
|
|
04-10-2011, 01:46 PM
|
#13 (permalink)
|
|
learn more share more....
Join Date: May 2011
Posts: 36
|
Re: send mails using php
wat do i give fr smtp_server,auth_username,auth_password?
|
|
|
04-10-2011, 01:55 PM
|
#14 (permalink)
|
|
Simply a DIGITian
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
|
Re: send mails using php
Yup.
10chars
__________________
- Read The Forum RULES First.
- Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
- Before Starting A New Thread Read The STICKY THREADS First
- Before Participating In Bazaar Section Read The BAZAAR RULES
|
|
|
04-10-2011, 01:56 PM
|
#15 (permalink)
|
|
learn more share more....
Join Date: May 2011
Posts: 36
|
Re: send mails using php
sry m nt undrstanding dat part.wat values am i supposed to give der?
|
|
|
04-10-2011, 09:34 PM
|
#16 (permalink)
|
|
Sami Hyypiä, LFC legend
Join Date: Jun 2007
Location: Нью-Дели
Posts: 2,138
|
Re: send mails using php
Use an SMTP relay like JangoSMTP.
|
|
|
04-10-2011, 10:05 PM
|
#17 (permalink)
|
|
learn more share more....
Join Date: May 2011
Posts: 36
|
Re: send mails using php
ok i used.but after 4-5 mails i recieved error mails.and can i send mails to any mail id's or to oly the ones which i have added in jangosmtp?
|
|
|
04-10-2011, 10:14 PM
|
#18 (permalink)
|
|
Sami Hyypiä, LFC legend
Join Date: Jun 2007
Location: Нью-Дели
Posts: 2,138
|
Re: send mails using php
|
|
|
05-10-2011, 09:36 AM
|
#19 (permalink)
|
|
learn more share more....
Join Date: May 2011
Posts: 36
|
Re: send mails using php
System.Exception: This From Address ("postmaster@localhost") is not
allowed to send through this account.
at JangoEmlRelay.Relay.ProcessFile(Object o)
i get d above error as a mail from jango.
|
|
|
05-10-2011, 09:42 AM
|
#20 (permalink)
|
|
Sami Hyypiä, LFC legend
Join Date: Jun 2007
Location: Нью-Дели
Posts: 2,138
|
Re: send mails using php
Yes of course. Use a proper From E-Mail address. Like your actual E-Mail address.
|
|
|
05-10-2011, 09:43 AM
|
#21 (permalink)
|
|
learn more share more....
Join Date: May 2011
Posts: 36
|
Re: send mails using php
but it worked fine wid frst 4-5 test mails....
|
|
|
07-10-2011, 03:39 PM
|
#22 (permalink)
|
|
.
Join Date: Jun 2007
Location: New Delhi
Posts: 8,944
|
Re: send mails using php
lol..last time when I did this, I preferred using a MTA like exim4.
__________________
.
|
|
|
| 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
|
|
|
|
|
|