amkaos Posted May 18, 2013 Share Posted May 18, 2013 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 Quote Link to comment https://forums.phpfreaks.com/topic/278126-q-where-is-mailer-in-this-code/ Share on other sites More sharing options...
amkaos Posted May 18, 2013 Author Share Posted May 18, 2013 (edited) 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"; } } ?> Edited May 18, 2013 by amkaos Quote Link to comment https://forums.phpfreaks.com/topic/278126-q-where-is-mailer-in-this-code/#findComment-1430803 Share on other sites More sharing options...
trq Posted May 18, 2013 Share Posted May 18, 2013 What is the question? Quote Link to comment https://forums.phpfreaks.com/topic/278126-q-where-is-mailer-in-this-code/#findComment-1430807 Share on other sites More sharing options...
amkaos Posted May 18, 2013 Author Share Posted May 18, 2013 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? Quote Link to comment https://forums.phpfreaks.com/topic/278126-q-where-is-mailer-in-this-code/#findComment-1430842 Share on other sites More sharing options...
Jessica Posted May 18, 2013 Share Posted May 18, 2013 if(mail ($email, $emailsubject, $body, "From: $fromname <$fromemail>")) is the line that sends the mail. "mailer" doesn't mean anything. Quote Link to comment https://forums.phpfreaks.com/topic/278126-q-where-is-mailer-in-this-code/#findComment-1430845 Share on other sites More sharing options...
amkaos Posted May 18, 2013 Author Share Posted May 18, 2013 (edited) if(mail ($email, $emailsubject, $body, "From: $fromname <$fromemail>")) is the line that sends the mail. "mailer" doesn't mean anything. 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 Edited May 18, 2013 by amkaos Quote Link to comment https://forums.phpfreaks.com/topic/278126-q-where-is-mailer-in-this-code/#findComment-1430850 Share on other sites More sharing options...
Jessica Posted May 18, 2013 Share Posted May 18, 2013 I have never written a tutorial about PHP Mailer, probably because I've never even used it. You don't have to supply anything like mail.domain.com. Quote Link to comment https://forums.phpfreaks.com/topic/278126-q-where-is-mailer-in-this-code/#findComment-1430863 Share on other sites More sharing options...
kicken Posted May 18, 2013 Share Posted May 18, 2013 i still dont know what would be shown to recipient about where the email came from... What the user sees as who the message is from comes from the From: header, which you can see being set in the sample code. if(mail ($email, $emailsubject, $body, "From: $fromname <$fromemail>")) //^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Right there. Quote Link to comment https://forums.phpfreaks.com/topic/278126-q-where-is-mailer-in-this-code/#findComment-1430884 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.