jalen Posted June 1, 2009 Author Share Posted June 1, 2009 this is what I have in my php ini for these: [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 what should I change this to? Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-846593 Share on other sites More sharing options...
.josh Posted June 1, 2009 Share Posted June 1, 2009 Well if you did that on purpose and WANT your email hardcoded there, then why did you turn around and post code putting $_POST there? It makes me think you're either lying or don't know what you're talking about. Are you.... a) wanting to send it to the same email (your email) no matter what? ---> Assign your email address to $my_email like you claim you did (initially): $my_email = "jalen@someplace.com"; // or wherever b) wanting to send to whatever you specify in that first "Email address" input field in your form? ---> Assign it the posted var like I said (exactly like that, no changing anything): $my_email = $_POST['my_email']; Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-846594 Share on other sites More sharing options...
jalen Posted June 1, 2009 Author Share Posted June 1, 2009 Are you.... a) wanting to send it to the same email (your email) no matter what? ---> Assign your email address to $my_email like you claim you did (initially): $my_email = "jalen@someplace.com"; // or wherever I want it like this, didn't know what you mean before. But I wouldn't mind later on do it that way when I need to, good to know both. thanks. Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-846599 Share on other sites More sharing options...
MadTechie Posted June 1, 2009 Share Posted June 1, 2009 what should I change this to? Okay well this depends on your mail service provider, You need to enter the details as if you was setting up the account on MacMail or Outlook ie heres some details i sent to a client, (edited a little) Mail Server Email: jayne@mydomain.com Mail Server Username: jayne+mydomain.com Mail Server Password: Wdgffgh123sNt Incoming Mail Server: mail.mydomain.com Outgoing Mail Server: mail.mydomain.com (server requires authentication) Now Outgoing Mail Server: mail.mydomain.com is would be used ie SMTP=mail.mydomain.com the problem is mine require authentication password, so to save time i could use PHPMailer as mai() doesn't support authentication Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-846600 Share on other sites More sharing options...
jalen Posted June 1, 2009 Author Share Posted June 1, 2009 so to get it to work all i need to change in the php ini is this? SMTP=mail.mydomain.com from how I have it now as: SMTP = localhost Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-846604 Share on other sites More sharing options...
MadTechie Posted June 1, 2009 Share Posted June 1, 2009 If your PC is running as a mail server then localhost is fine, (i assume it's not) So you need to change it to whatever your mail server is! i assume you have the email setup and the details to hand ! Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-846610 Share on other sites More sharing options...
jalen Posted June 1, 2009 Author Share Posted June 1, 2009 I have never really work with mail with php before, so I don't know what mail server you are talking about and also mail setup. Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-846615 Share on other sites More sharing options...
jalen Posted June 1, 2009 Author Share Posted June 1, 2009 PFMaBiSmAd now I only have this error: 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:\Apache\htdocs\FormToEmail.php on line 197 failed Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-846626 Share on other sites More sharing options...
MadTechie Posted June 1, 2009 Share Posted June 1, 2009 These are email settings nothing much to do with PHP atall.. PHP uses them yes do you know what your mail server is ? Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-846635 Share on other sites More sharing options...
cunoodle2 Posted June 1, 2009 Share Posted June 1, 2009 The problem is on line 37. I honestly would have to say that this is one of my favorite responses EVER on phpFreaks. Pure comedy at it's finest. Infact I'm going to put this in my signature. LOVE IT!! Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-846678 Share on other sites More sharing options...
jalen Posted June 2, 2009 Author Share Posted June 2, 2009 These are email settings nothing much to do with PHP atall.. PHP uses them yes do you know what your mail server is ? you mean yahoo.com mail server? this is what I use yahoo.com so far. Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-847422 Share on other sites More sharing options...
jalen Posted June 2, 2009 Author Share Posted June 2, 2009 I have looked at the ports http://www.hostmysite.com/support/email/telnet/ and with the sending test, I get a message similar to the correct one but the received one it totally failed I even enable and open port 110 and that still failed. I still can't send mail to my email and still gets this error message: 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:\Apache\htdocs\FormToEmail.php on line 197 failed any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-847486 Share on other sites More sharing options...
jalen Posted June 2, 2009 Author Share Posted June 2, 2009 I have three php ini file: PHP configuration setting PHP ini dist PHP ini recommended which one is the one I use and should look at? Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-847487 Share on other sites More sharing options...
MadTechie Posted June 2, 2009 Share Posted June 2, 2009 yahoo's uk mail server is smtp.mail.yahoo.co.uk Check the box next to "My outgoing server (SMTP) requires authentication." BUT it requires authentication, if your account require authentication then try phpmailer() Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-847902 Share on other sites More sharing options...
jalen Posted June 2, 2009 Author Share Posted June 2, 2009 smtp.mail.yahoo.co.uk Check the box next to "My outgoing server (SMTP) requires authentication." what box? Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-848191 Share on other sites More sharing options...
MadTechie Posted June 2, 2009 Share Posted June 2, 2009 Thats a Quote from: http://help.yahoo.com/l/uk/yahoo/mail/yahoomail/pop/pop-06.html I was saying yahoo accounts require authentication, so use phpmailer() Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-848212 Share on other sites More sharing options...
jalen Posted June 3, 2009 Author Share Posted June 3, 2009 that is for outlook. Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-848231 Share on other sites More sharing options...
jalen Posted June 3, 2009 Author Share Posted June 3, 2009 MadTechie from what I know is that form to mail in local environment is more complicated than an internet hosting am I right? and if I am, do you know how to get it to work on local environment. if you can, walk me through each step on how to get it to work pls. thanks. Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-848273 Share on other sites More sharing options...
MadTechie Posted June 3, 2009 Share Posted June 3, 2009 Download PHPMailer and create a gmail account and try the script below <?php require_once('../class.phpmailer.php'); $mail = new PHPMailer(); $body = "testing <b>PHP Mailer</b> wooohooo"; $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPDebug = 2; // enables SMTP debug information (for testing) // 1 = errors and messages // 2 = messages only $mail->SMTPAuth = true; // enable SMTP authentication $mail->SMTPSecure = "ssl"; // sets the prefix to the servier $mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server $mail->Port = 465; // set the SMTP port for the GMAIL server //update $mail->Username = "yourusername@gmail.com"; // GMAIL username $mail->Password = "yourpassword"; // GMAIL password $mail->SetFrom('yourusername@gmail.com', 'First Last'); $mail->Subject = "PHPMailer Test Subject via smtp (Gmail), basic"; $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test $mail->MsgHTML($body); $address = "whoto@otherdomain.com"; $mail->AddAddress($address, "John Doe"); if(!$mail->Send()) { echo "Mailer Error: " . $mail->ErrorInfo; } else { echo "Message sent!"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-848318 Share on other sites More sharing options...
jalen Posted June 3, 2009 Author Share Posted June 3, 2009 I will download phpmailer and give it a try and let you know. Do you know if on a live hosting server, not localhost, would I still need to download phpmailer for it to work and how does the process work compare with local environment? I know my host provide built in form mail but it is limited in it's function from what I've seen. 1 - limited in number of email it can send out 2 - limited in standard subject line etc. and maybe other limitation I may not know of, is why I like to customized my own script and create flexibility. Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-848335 Share on other sites More sharing options...
MadTechie Posted June 3, 2009 Share Posted June 3, 2009 You don't need it it just makes like eaiser for you.. No matter where your mail server is located limits are limts, you could host it yourself but that can cause other problems, limit on mails send shouldn't be a problem (depends what your sending i guess), i have no idea what you mean by "limited in standard subject line" as for the setting for yahoo, yes you can use them in outlook but the setting are the same host:port, connection type, username, password Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-848338 Share on other sites More sharing options...
jalen Posted June 3, 2009 Author Share Posted June 3, 2009 i have no idea what you mean by "limited in standard subject line" I just tested my host formmail built in function: this is what it said to do: You have to modify the following code on your form page: <form action="/cgi/formmail" method = "POST"> 2. Specify Recipient E-mail address (limit is maximum 2 recipients) Next you must have the following line of code after the form action tag we entered above: <input type=hidden name="recipient" value="you@yourdomain.com"> OR <input type=hidden name="recipient" value="you@yourdomain.com,anothername@anotherdomain.com"> when I set up the form and tested it so it send it to my personal email, I noticed that the subject is: WWW Form Submission and there is a limit on two email distribution, I would like more. and what if I want the action to run another php program, then I can't use their formmail built in. Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-848347 Share on other sites More sharing options...
MadTechie Posted June 3, 2009 Share Posted June 3, 2009 I would like more. and what if I want the action to run another php program, then I can't use their formmail built in. That shouldn't be a problem, have you got it emailing ? Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-848414 Share on other sites More sharing options...
jalen Posted June 3, 2009 Author Share Posted June 3, 2009 yea I looked at my email and I see it sent from the from. But I would like it to send to not just two but more, customized subject either I set it or user filled it, and I would like to run other php/html application while do so. Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-848458 Share on other sites More sharing options...
MadTechie Posted June 3, 2009 Share Posted June 3, 2009 To send to more just use $mail->AddAddress("John@doe.com", "John Doe"); $mail->AddAddress("Jane@doe.com", "Jane Doe"); subject, same idea $mail->Subject = "PHPMailer Test Subject via smtp (Gmail), basic"; I would like to run other php/html application while do so. No idea what you mean! Quote Link to comment https://forums.phpfreaks.com/topic/160423-form-to-mail/page/2/#findComment-848463 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.