oceans Posted April 25, 2007 Share Posted April 25, 2007 Dear People, Is It OK if any one would help me to do "Send an Email", I understand sending an email: " <?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."; ?> " codewise it should not be a problem, I have sent emails in VB6.0, thus I know need to supply (1) smtp address, (2) port=25, my (3)email address to complete the transection. Can you please guide me how to supply, thanks. I have Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/ Share on other sites More sharing options...
benjaminbeazy Posted April 25, 2007 Share Posted April 25, 2007 are you trying to send from your home computer or something oceans? Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-237866 Share on other sites More sharing options...
oceans Posted April 25, 2007 Author Share Posted April 25, 2007 work computer, I have the port it is not 25, it is XXXX(i can't tell the number boss will kill me) I have the smtp address also, I amended php.ini [mail function] ; For Win32 only. SMTP = mail.xxxx.com smtp_port = XXXX but the error on the screen is " 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:\wamp\www\MyPHP\Member\Untitled-2.php on line 14 " My values are not used Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-237872 Share on other sites More sharing options...
benjaminbeazy Posted April 25, 2007 Share Posted April 25, 2007 i'm sure it's listed somewhere in php.ini but otherwise, you can locally change the values using ini_set() like this ini_set('smtp_port', 25); ini_set(SMTP, 'HOST_NAME'); look up ini_set for more info oh ok, i get what you're saying about php.ini Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-237879 Share on other sites More sharing options...
oceans Posted April 25, 2007 Author Share Posted April 25, 2007 Friend, I have already changed in the ini file, then the screen said so. I will do you advice now. Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-237881 Share on other sites More sharing options...
benjaminbeazy Posted April 25, 2007 Share Posted April 25, 2007 yeah i got ya on that, im running on 3 hrs sleep 24+ hrs awake, so my graymatter aint firing all that great Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-237883 Share on other sites More sharing options...
oceans Posted April 25, 2007 Author Share Posted April 25, 2007 Friend, Have a break 24hrs UP, I will see stars not on the sky but in my eyes. OK your solution works, but please tell me must do this for (i) every mail sent (ii) every page, (iii) once only per server. Benjamin, You have not mentioned where are you. Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-237895 Share on other sites More sharing options...
benjaminbeazy Posted April 25, 2007 Share Posted April 25, 2007 i am at home, i work from home here in Bay City, MI. Madonna was raised here. that's our only claim to fame.... these are local settings, i.e. it only works while the script is processing. so depending on how you set it up, you could have to do this for every email, or .. if your making an email script just put those at the top and it will be AOK... Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-237901 Share on other sites More sharing options...
oceans Posted April 25, 2007 Author Share Posted April 25, 2007 Thanks, wish not to bother you anymore today. Have a great time! Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-237915 Share on other sites More sharing options...
oceans Posted May 17, 2007 Author Share Posted May 17, 2007 Dear Friends, I am slightly confused with my syntex, I will give you my port and address, can you insert into the ini_set found below, I feel somthing is not right, thanks. smtp.starhub.net.sg 25 ini_set('smtp_port', 25); ini_set(SMTP, 'HOST_NAME'); Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-254999 Share on other sites More sharing options...
oceans Posted May 17, 2007 Author Share Posted May 17, 2007 People I have solved, just an additional "stop" killed me for days. I have another situation, When I put it into an automated email system, I noted that the instructions after the email procedure waits for the email to be over then continues, this way all the instructions after the emails waits and hogggggggssss. Can we make it "trigger an email" and go. Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-255147 Share on other sites More sharing options...
jitesh Posted May 17, 2007 Share Posted May 17, 2007 Download and use phpmailer class to send smtp mail. http://phpmailer.sourceforge.net/ Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-255154 Share on other sites More sharing options...
oceans Posted May 17, 2007 Author Share Posted May 17, 2007 Dear Friend, I am reading now, will get back, if I can't get it right. Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-255158 Share on other sites More sharing options...
Starfox Posted May 17, 2007 Share Posted May 17, 2007 I'm having email issues also. my php based forum software will not send emails. And I wrote a basic php sendmail() to test it, and it says it sends it, no errors, but I never receive anything in my inbox. What could be the problem? especially with standard php mailsend?? thanx Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-255164 Share on other sites More sharing options...
neel_basu Posted May 17, 2007 Share Posted May 17, 2007 You can do it by changing the ini file test by using ini_get(); Else Use the mail class from here http://zigmoyd.sourceforge.net/man/mail.php#mail This Page http://zigmoyd.sourceforge.net/man/index.php Describes how to Install it and instruction Open teh setup_mail.php file and Change the following ............................. var $host = "HOST"; var $port = 25;//Port number ................................. And you are ready dont downloload the current version 1.0.1.0 it has a Bug Download the 1.0.0.1 Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-255166 Share on other sites More sharing options...
neel_basu Posted May 17, 2007 Share Posted May 17, 2007 ~Starfox have you checked your Junk mail folder ?? Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-255169 Share on other sites More sharing options...
oceans Posted May 17, 2007 Author Share Posted May 17, 2007 Dear Friends, I am glade that two of you have suggested us API like features. May I ask two questions. (1) I want "email and go" type, I do not not want my after email instructions to wait for the outcome of the email, the reason, in automated email this will hog all users on queue. (2) Have you tested my idea before, please comment. Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-255171 Share on other sites More sharing options...
Starfox Posted May 17, 2007 Share Posted May 17, 2007 Yeah I have. I have 2 php forums, one phpbb and one SMF, and I also wrote a simple sendmail code, none of these 3 worked. I don't understand it. Especially the forums, they use basic php mail sending, I don't understand why it shouldn't work. Must be something to do with my server perhaps. Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-255172 Share on other sites More sharing options...
neel_basu Posted May 17, 2007 Share Posted May 17, 2007 I didn't understand This line "I do not not want my after email instructions to wait for the outcome of the email, the reason, in automated email this will hog all users on queue." I am poor in English But 2 Side notes 1. I've told it can be done using ini_set() thats why I've told you test using ini_get(). 2. Zigmoyd will send the mails IMMEDIETLY even it can show how its sending and how its talking with the SMTP server. So no Queue. Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-255178 Share on other sites More sharing options...
oceans Posted May 17, 2007 Author Share Posted May 17, 2007 Dear Neel, Example Bla Bla Bla 1 Send Email Bla Bla Bla 2 With my traditional code: (i) Bla Bla Bla 1 gets excuted, (ii) Bla Bla Bla 2 gets excuted only after the email sequence has been done (it does not matter pass or fail). What I want is: (i) Bla Bla Bla 1 gets excuted, (ii) trigger email (iii) Bla Bla Bla 2 gets excuted without waiting for email sequence has been done. I am sorry I clustered all into one phrase earlier. Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-255189 Share on other sites More sharing options...
neel_basu Posted May 17, 2007 Share Posted May 17, 2007 One Socket (Programm) cant send 2 mails through 1 SMTP server at the same time . There must be a queue that after (Successful OR Unseccfull) sending of a mail it starts sending the second mail. else If you create two mail objects it wil probabbly create two different Sockects to send mail as then there are more than one soclkets you can send 2 mails at ~ same time And Weather it will check for the previous mail has been sent or not it depends uppon you . And if you have to send more mails you need to use group_mail class . And whatever script you use in PHP SMTP server always queues the mails by itself. Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-255197 Share on other sites More sharing options...
neel_basu Posted May 17, 2007 Share Posted May 17, 2007 ~ Starfox The mail goes to your Junk folder ?? Quote Link to comment https://forums.phpfreaks.com/topic/48578-sending-email/#findComment-255203 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.