Jump to content

amkaos

Members
  • Posts

    11
  • Joined

  • Last visited

amkaos's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. hello jessica.. i once saw a tut that you authored using phpmailer.. i looked again but didnt find it.. i want to make a form list names and emails from a mysql database.. then sending them emals.. do you talk about using phpmailer for this? thanx for your reply in this thread.. i didnt understand that 'mail' is its own functtion..i was looking for 'mail.domain.com' i still dont know what would be shown to recipient about where the email came from... thanx
  2. the question is.. this thread is about successful emailing from databse using php yet i dont see the mailer coded in the php.. what am i missing?
  3. sorry ,, this is code.. i think include("config.php"); mysql_connect($db_host, $db_user, $db_pwd); mysql_select_db($db_name); if (!$_POST) { include("form.php"); } else { $formbody = $_POST['formbody']; $sql = "SELECT $db_usernamefield, $db_emailfield FROM $db_table"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)){ $username = $row['username']; $email = $row['email']; $body = "$formbody"; $body = str_replace("[username]", $username, $body); if(mail ($email, $emailsubject, $body, "From: $fromname <$fromemail>")) echo "Messages sent"; } } ?>
  4. Hi: i ve been looking at other ppl's success @ pulling info from sql database then emailing .. i see this old thread. http://forums.phpfreaks.com/topic/51205-solved-email-all-addresses-in-a-mysql-table/?hl=%2Bphpmailer+%2Btutorial i am not seeing the actual mailer... ex.) mail.domain.com .. etc.. why does this work? it does seem that phpmailer can work for this also? i am verry new to this and appreciate the patience.. thanx
  5. could you be a little bit more specific.. an example? i did change this: $to = $_GET["mail_$x"]; to this $to = "myactualemail@gmail.com" i have been sending to myself..w/o any love thank you for your reply..
  6. hi: i have this form.php.. type address for form and it displays all names and email address from sql database. i type in message into box and send to all recipients listed on form. the connection is successful .. the mail gets processed but no emails are sent. i use this on a real web host.. not xammp etc. i think the problem may be in this line but every change i tried doesnt work.. :: ini_set("SMTP", "mail.tap~~.com"); full code here: require('connect.php'); // change php.ini smtp line ini_set("SMTP", "mail.tap~~.com"); // standard mail header $headers = "From: Tap~~"; // get meessage to send $message = $_GET['message']; // loop through names / emails on index form for ($x=0; $x<count($_GET); $x++) { if ($_GET["mail_$x"]) { // mail setup $to = $_GET["mail_$x"]; $subject = "News From Tap~~"; $body = "Dear " . $_GET["name_$x"] . " \n\n $message \n\n Josh \n\n Tap~~ "; mail($to, $subject, $body, $headers ); } } echo "All Mail Has Been Processed"; i have searched about this for hours.. i really appreciate the looksy thanx
  7. Hi: i have simple form. i use an external javascfipt file to validate required fields.... works fine if user has java turned on. i have an external php file to validate after js .. it has separate error page listing missing fields..and a thank you page that works if form passes validation i really want the php to report missing fields next to the actual boxes like the js does.. this is my jsbin link showing the html , css and js + preview window and how it works.:: http://jsbin.com/osahah/1/edit this is my php file Send_Questions.php ------------------------------- in trying to put errors next to same fields, i changed this working HTML code snip: <div class="input"> <input type="text" name="email" id="email" size="30" /><span class="emailError, emailError2"></span> <div class="error" id="emailError"> <p stlye="float:left"/>Required: Please enter your email address </div> to this:: <div class="input"> <input type="text" name="email" id="email" size="30" /><span class="emailError, emailError2"></span> <div class="error" id="emailError" value="<?php echo $error_message; ?>"><br> <p stlye="float:left"/>Required: Please enter your email address </div> i also tried :: <div class="error" id="emailError" <span>"<?php echo $error_message.='Required: Please enter your email address'; ?></span><br> <p stlye="float:left"/>Required: Please enter your email address </div> the first snip is for js validation..it displays errors next to appropriate fields IF user java is turned on. i wanted to keep the js validation and add the php validation using an external php file.. of course the php example doesnt work.. the $error_message comes from the .php file.. am i close?.. i have tried moving the tiny php line to other locations,, also i tried with and without the <span> tag.. still i get taken to the error page.. thanx for lookin i appreciate any help
  8. Dear exe trix:: thanx for your reply last week.. i was so tired and blurry that day, i didnt see what was in front of me.. this project is for our not-for-profit club and i did not come back to it until today. i now see what you gave me. i think i understand and will try to adapt to my use. i am concerned to use this as worry-free tho. i do not make habit of joining forums for help and offending anyone who posts for my benefit.. sorry again.
  9. thanx again for helping.. i just wanted to understand what you are showing me.. i am new and not sure what im looking at.. i am probly a little bit dizzy .. i ve been trying hard on my own for a while before i come here.. this is my real contact form from our non profit org..and how it works for now.. http://www.kcorchidshow.org/OSGKC_Questons.html
  10. Hi: thanx for the replies.. this is where i took reference from:: http://phpmaster.com/form-validation-with-php/ can i assuse that your code gives me the missing-req'd-info errors on same page? i do have working contact page and when req'd info is not complete, user is taken to page saying whats missing.. the report on the same form page is much nicer. thanx
  11. Hi: brand new to php. need help w/ form. i want to display omitted but required information on same page as the form after validation. also, to keep the user data filled in.. i got this from php master tut.. it does not work. i changed actual sites and personal info to generic any help is greatly appreciated... thanx <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Untitled Document</title> </head> <body> <?php if(isset($_POST['email'])) { // EDIT THE 2 LINES BELOW AS REQUIRED $email_to = 'myemail.com'; $email_subject = "Questons Form"; $emailErr = $commentsErr = ""; $email = $comments = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { if (empty($_POST["email"])) { $emailErr = "Missing"; } else { $email = $_POST["email"]; } $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "Comments: ".clean_string($comments)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <!--include your own success html here --> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR...nsitional.dtd"> <html> <head> <meta http-equiv="Refresh" content="10; URL=website_form.html"> <title>form show</title> <meta http-equiv="Content-Language" content="en-us" /> <meta http-equiv="imagetoolbar" content="no" /> <meta name="MSSmartTagsPreventParsing" content="true" /> <meta name="description" content="Society presents annual in 2012, at American Center. " /> <meta name="keywords" content="Society ,Center" /><style type="text/css" media="all">@import "css/master.css";</style> <body> <p><div id="textbox"><br><br> <center><h1>Thank you for contacting us. <br /> We will be in touch with you very soon.</h1> <br><br> Please wait 10 seconds and you will be transferred to the next page or <a href=show.org/index.html><font color="#0000ff">click here</font></a> to go now!</center> <p><center>Please visit our website <a href="show.org/"><i>www.show.org</i></a> to learn more <br /> about the Society </center> <p> </p> </div> </div> </div> </body> </html> <?php { } ?> </body> </html>
  12. Hi: new to php + here.. i really wanna understand this. thanx for having me.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.