Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    PHP


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Using MYSQL Result To Send Mail


I have wrote a program to load a number of email address from the MYSQL database. And I have use
"$mail = mysql_query("select email from user;",$link_ID);

Now, I want to use mail() to send email to those e-mail account I got. What should I do for this?




View Complete Forum Thread with Replies

Related Forum Messages:
Send Mysql Query Result Displayed In A Table
I have just created a shopping cart and I would like to send my user the receipt of there order by email. The receipt is generated by a mysql query and is displayed within a table. I have worked out how to send a html using simple HTML code as my “$message� variable: $success = mail($to, $subject, $message, $headers);

But I can not get it to send my mysql query result displayed in a table. How can i create the result of my mysql query and make it a simple variable i.e $message.

View Replies !
Mail A Set Of Addresses From A MYSQL Result
I'm populating a field in MYSQL that collects email addresses for a certain topic and saves them like this:

mail1@mail.com|emailaddress2@mail.com|email3@email.com

- Basically what I'd like to do is explode the data, and set up a mailer from PHP that informs each of the addresses individually that there has been an update to the topic.

I *don't* want each of the mail addresses to be visible to all the recipients on the list, so simply inserting the data into the TO: field won't do, because then all the addresses are visible, causing security concerns. Code:

View Replies !
Get The Mail Function To Send Mail After Processing My Forms Locally
I am using an Apple Mac Book Pro computer on which I am running MAMP (Macintosh, Apache, Mysql, PHP) I can not get the mail function to send mail after processing my forms locally. I checked the php.ini file to see what could be the problem and I believe I have it configured properly.

View Replies !
Send Ping And Log Result To File
I want to have a php script which pings a host with ping 1.1.1.1 -t all the
time and it shoukld write these things to a logfile.

When it comes like "timout exceeded" it should write this only once to a
file. Because if timout is 2000 times I don't want to have timeout exceeded
200 times in a database.

But when ping times are coming they should be logged in a file with date and
time when the ping accured.

Is this possible? - if yes, how?

View Replies !
Mail Function :: Send Form In HTML Mail
I am trying to use the PHP mail function to repopulate the information that has been filled out on a form and send the form out in an html email the same way that it looked when the individual filled it out. The problem I am having is with the Radio buttons and repopulating them. Code:

View Replies !
Php Mail() Function Doesn't Send To Pop3 Mail Address
I'm writing a registration script for een webhosting company but the mail() function i used works only for hotmail addresses and not for pop3 email accounts, it also works for other not pop3 email accounts, does any one know what i should do to make this work. I used the same method before on an other server and there it worked perfectly.

View Replies !
Send A Simple Variable Like A Result From A Query To Flash?
How to send a simple variable like a result from a query to Flash?

View Replies !
Why Does Mail() Only Send Messages To Some E-mail Addresses?
I've got a form that I use to collect information and store it in a MySQL database and use PHP to send a mail() message confirming registration. When I use my work e-mail address, I never receive the message, but when I use my home e-mail address, I get it right away. What am I doing wrong?

View Replies !
PHP Mail() Function Failing To Send Mail
Our setup: PHP 4.3.11, FreeBSD 5.3 RELEASE, Sendmail 8.1, 1 host
environment, 2 jails.

Our problem: While we can send email from the command line just fine
in one of the jails, we cannot use the php mail() command to send email
using sendmail at all. The function, when executed, does absolutely
nothing. No error, no reports to the maillog, nothing.

I've read somewhere that it's "not possible" to send mail using the php
mail() function within a freebsd jail, but i'm nearly certain we have
it working this way on another server, but can't seem to figure out the
issue.

View Replies !
Send Out The Most Basic E-mail Using PHP And The Mail() Function.
im trying to send out the most basic e-mail using PHP and the mail() function.
the problem i have is that it will always return true but the message is never received and im not sure if its even sent. heres my code....

      $email = "jonathangilmartin@yahoo.co.uk";
      $subject = "Subject!";
      $body = "whatever you want to email";
      $from = "From: Jon <john@beach.es>";
      $p5 = '-f john@beach.es';
if(mail($to,$subj,$mesg,$from,$p5)){
echo " sent ok ";
}
else {
echo " failed ";
}

I think the problem I have could be due to the server I am hosting the site on, but dont quote me on this as im not sure. The site is hosted on my university server, ive now graduated so I cannot ask the support team if any ports are blocked. Does anyone know a way of testing a servers ports, if this is even necessary of course !

can anyone explain the typical server requirements to send e-mail using PHP, i assume port 25 must be open and the server must accept SMTP. Forgive me for asking a dumb question but I take it that i cannot test the mail() function from my testing apache server installed on my local PC ?

Also you will have noticed that i have a yahoo e-mail address, would i have to make any changes to my account to get this working ?? its only a standard free e-mail account.

View Replies !
Mail() Code Doesn't Seem To Send Any Mail
mail($toemail, "Greetings card from $from", $message, "FROM:Website Name<noreply@ourdomain.com>") or die("MAIL NOT SENT");

This code doesn't seem to send any mail - any ideas? Also are there any more advanced features that can be added to validate if the email is sent or not?

View Replies !
Mail Function Send Mail And Attachement
i can send mail and attachement in php with "mail function "

$s = mail($to,$subject,$cont, $headers);

View Replies !
Using The Mail() Command To Send Out An E-mail Message.
I am using the mail() command to send out an e-mail message. But, I am getting different results between two different clients. I am curious if this is a PHP problem, or just a problem with the way the clients are interpreting the headers. Code:

View Replies !
Formmail Send The Form As A Mail (mail())c
-one html -file containing a form, submitting the form (action, onSubmit)
-redirecting to a php processing -file, configure and send the form as a mail (mail())
-if mail() returns true: redirect to the form, AND a new window containing submitted data from the form poping up. Close popup window: return to the form.

View Replies !
Send Mail Using Mail() With Attachment
im trying to find out how to send an email with the mail() function and add an attachment

basically i want the user to be able to send an email and browse their computer and attach a word doc to the email any ideas on the attachment bit ?

View Replies !
Mail Function - How To Send Mail With Php.
I'm learning how to send mail with php. only thing that mystifies me a bit is I can't get NAME of sender to appear in e-mail INBOX under "from". I only see e-mail address. I'm
coming from Java, with Java you can set it up so whatever user puts under "name" in the form you can grab and in e-mail INBOX under "from" you see sender's name, not e-mail address. I would like to be able to do this with php.

View Replies !
Query Result In A Mail!
How do I insert a query result in a mail()? PHP Code:

View Replies !
Adding Result Row To Mail Function
I have an email script that will pull the addreses from my club membership database. That part works fine. the problem I am having is being able to include row results inside of the actual email message. My message variable is something like this: Code:

View Replies !
Mail To Multiple Recipients From Query Result
I was wondering if anyone knows if there is a way to mail to mulitple recipients that are derived from a query?

$query = mysql_query("SELECT email FROM users WHERE title = 'Project Manager'");
while ($row  =  mysql_fetch_array($query)){
$manager_email = "$row[email]";
                    }

$contactemail = $manager_email;
$headers .= "To: ".$contactemail."";

So how do you do this when there are more than one manager emails?

View Replies !
Mail() Function - Using The Mail() Function To Send Emails To Members Of A Website
I am using the mail() function to send emails to members of a website. For some reason when I include words such as "free" or "winner" the mail does not send to any of the addresses - it just seems to disappear in space. I figured this out by trial and error - once I removed those words, it worked. I am running cPanel on the server and have no problem sending emails as long as they don't use those words. It seems to be blocking certain words - ones that I assume spammers would use.

View Replies !
Why Can't I Send A Mail With PHP
I can't send a mail with the following mail header:
$headers = "MIME-Version: 1.0";
$headers .= "Content-type: text/html; charset=iso-8859-1";
$headers .= "From: "User" &lt;user@inter.net&gt;";

Therefore $headers is set to (echo $header;)
MIME-Version: 1.0 Content-type: text/html; charset=iso-8859-1 From: "User"
<user@inter.net>

The mail has not been delivered and my PHP server says:
[24-Nov-2005 00:37:19] PHP Warning: mail() [<a
href='function.mail'>function.mail</a>]: SMTP server response: 501 5.5.4
Invalid Address in C:PHPfile.php on line 132

If I use
$headers .= "From: user@inter.net";
instead of
$headers .= "From: "User" &lt;user@inter.net&gt;";

is works perfect.

View Replies !
Cant Send Mail
The problem is I am the mail server administrator also. This is a small
company of 4 ....

View Replies !
Send Mail In Jsp
how to send a mail using jsp on a linux platform (cobalt)...i have tried using the smtp part,but is gives the security access error.

View Replies !
PHP Doesn't Send Mail
I can't make my PHP send mail even if I set an SMTP for it? What could I have missed. Upon using mail(), it sends a true flag, but I never receive the mail. Why? What have I missed out.

View Replies !
How To Send An E-mail....
I have a form and one of the fileds is a users e-mail address

I have the validity set-up and the form now works, accepts data and posts to
a mysql database - that side works great...

I now need to use the e-mail field in the form to send a mail back to the
user who entered the form to let them know registration was a sucess...

How do I do that?

I'm suspect there is not an easy way so a link to a website or code would be
helpful..

Sorry about the crosspost - but this is an urgent one and I need a quick
answer... i've googled but founf nuthin :(

View Replies !
Can't Send A Mail
I don't know where my problem is. Hopefully someone can give me
some hint to explore the problem more. I am running Apache 2.0.48
wih PHP 4.3.4. The apache is running as nobody. I want to use the
mail() to send out the email from a web page but it can't work. The
web server is on the red hat linux 9.0 with rpm sendmail-8.12.8-9.90
and sendmail-cf.
In the begining, I got the error message, 'SYSERR(nobody) can not
write to queue directory /var/spool/clientmqueue/ when I use the
mail(). I kind of make some progress if not worse to follow the
sendmail/SECURITY. I don't see the error message above anymore.
However, the mail does not go out. Here is what I get in maillog now.
Dec 9 20:48:32 flash sendmail[7859]: hBA1mWr6007859: from=nobody,
size=112, class=0, nrcpts=0,
msgid=<200312100148.hBA1mWr6007859@flash.ninds.nih.gov>,
relay=nobody@localhost

View Replies !
Php - Send Mail
I'm using this bit of "send me an email" code in a different part of the site and it works great.

So, I pasted it after this insert query (see below) so as to learn when a "new member" has registered, but when I test it, I'm not receiving mail -- even checked the Bulk folder. What do I need to change to make this work? Code:

View Replies !
How To Send Mail
i got a dillema

i have :
$message = "name:$name
lastname:$lastname";
$message .= "hobby:$hobbies";
$mail ($to,$sub,$message);

but if they leave empty the hobby i don`t want to send  : hooby : <empty>  only to send 
$message = "name:$name
lastname:$lastname";
and if they complete the hobby  send the message completly
$message = "name:$name
lastname:$lastname";
$message .= "hobby:$hobbies";

something like this.

View Replies !
Mail() Won't Send
I'm having a problem with mailing large attachments (~20-50MB). The attachment contains ~100,000 to ~300,000 lines. There's no size limitation with the mail server. The function works fine when the attachment has less than 80,000 lines.

View Replies !
Mail Won't Send
this is my code for sending email to addresses from a DB unfortunately the email doesn't go out. do any of you know what's wrong with the code? PHP Code:

<?php
if($_GET['contact'] = "TRUE") {
$subject = $_POST['subject'];
$message = $_POST['message'];
$result = mysql_query("SELECT email, email2 FROM table WHERE username = 'Something' ") or exit(mysql_error());
while ($row = mysql_fetch_assoc($result)) {$list[] = $row['email'];}

$to = 'someone@free.net'
$headers .= 'to: someone@freet.net' . "";
$headers .= 'from: someone@freet.net' . "";
$headers .= 'bcc: ' . implode(',',$list) . ".............

View Replies !
Send Mail
here is my code:

mysql_connect ("host","user","pass") OR DIE ("unable to connect");
mysql_select_db ("database");

$select = "SELECT name, user, PASSWORD FROM `users` ORDER BY `name` ASC";

$query = mysql_qyery ($select) or die (mysql_error());

while ($row = mysql_fetch_array ($query)) {

$name[] = $row[0];
$user[] = $row[1];
$password[] = $row[2];

}....

View Replies !
Send Mail With Mail Function And "From: " Header
When I send mail with mail function and "From: " header, some SMTP servers uses that header, but other put root@localhost instead of my From header. Can I prevent this? I'm using Q-mail.

View Replies !
Send Mail From Another Host?
Is there any way to send an email message without using the mail server on the local machine?

for example: my computer is running apache and php. When some script is activated, I would like my computer to send out an email. But... I want to connect to another mail server to send the message as my local machine isnt running postfix or sendmail. Can this be done easily with php's functions?

View Replies !
PHP Mail() Function Doesn't Send To AOL?
I am running a PHP3 script, and I have noticed that it won't deliver messages to AOL. It DOES send email messages to mail accounts on my server, I have not tried anywhere else. Any ideas why I do not receive the email sent to AOL? Here is the code:

$email = "name@aol.com";
$subject = "From datera.com";
$message = $message."Tour the Web Now!n";
$message = $message."http://www.datera.comn";
mail($email, "$subject", $message, "From: datera@datera.comn");

NEVER GETS SENT?

View Replies !
How To Send Mail At A Later Time
I have a form on my site that I would like to generate an automated response from when it is submitted.

The trick is that I want the auto response to send an hour or so after the form is submitted. If I'm using PHP to send mail is there something I can add to the header of an e-mail to tell it to send at a specific time?

View Replies !
Send Mail Using 4 Parameters
Using windows XP, when I try to send mail using 4 parameters, I get this :
Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to
relay for ...

View Replies !
Send E-mail Notification
I have a table in mySQL with a birthday field in it, I need a PHP script that notifies the admin one day before about the users Birthday by sending him email reminder.

View Replies !
Function Will Not Send Mail!
I've created the below function to automatically send me an alert in outlook
when someone completes various forms on my website.

The problem though is that mail reports that I have only 1 of the 3 required
parameters defined!

I have no idea where this is going wrong, because as far as I can tell I
have defined all 3 parameters! Can anyone spot the problem?

<?PHP
function alert_outlook($Type)
{
$Type = strtolower($Type);

switch($Type)
{
case 'newsletter':
$Subject = 'message subject one here'
$Alert = "Hi,
Just thought you would like to know that there has been
another subscription to the newsletter!

";
break;

$Alert = wordwrap($Alert, 65);
}

//set headers etc
$Recipient = "Auto Alerts<AutoAlerts@domain.com>";

$Message = "

{$Alert}

";
$Message .= 'Date: ' . date("l, js F Y") . "";
$Message .= 'Time: ' . date("H:i:s") . "";
$Message .= 'IP Address: ' . $_SERVER['REMOTE_ADDR'] . "";
$Headers = "FROM: Auto Mailer<AutoMailer@Domain.com>";

mail("$Recipient, $Subject, $Message, $Headers");

//error check
if(!mail("$Recipient, $Subject, $Message, $Headers"))
{
return FALSE;
}
else
{
return TRUE;
}
}
?>

View Replies !
Php Send Mail Problem
I have a function to send UTF-8 encoded HTML Format email to user.

But my found that the produced email sometime accidently being injected
with the ! sign.......

e.g. <td> sometime become <!td>

here is the code for that function

$sql = "select * from user where userid='$userid'";
$res = send_sql($sql);
//Get Reserve staff info
$row = mysql_fetch_array($res);
$fusername = $row["UserName"];
$femail = $row["Email"];
$message= ERNST."<html><body>";
$message.= "Hi ".htmlspecialchars($fusername).",<br><br>";
$message.= "Please note that the system accepted your borrowing of
files at ".date("d M Y H:i:s")."<br>";
$message.= "<br>";
$message.= "<table width=ï`%' border=&#391;'>";
$message.= "<tr align='center'
bgcolor='#79B1D2'><th>FileID</th><th>Group</th><th>Client
Name</th><th>Client Code</th><th>Year
End</th><th>Type</th><th>Description</th></tr>";
$i=0;
foreach ($fileid as $x) {
$cname="";$gname="";$cc="";$yr="";$type="";$des="";
$query = "SELECT
c.clientname,g.groupname,clientcode,yearend,type,D escription";
$query .= " FROM Client c, f_group g, f_folderlist fl,f_file f";
$query .= " where fl.fileid='$x' and fl.fileid=f.fileid and
fl.clientid=c.clientid and c.grpid = g.gpid" ;
$res2 = send_sql($query);
$j=1;
while($row2 = mysql_fetch_array($res2)) {
$cname .= $j . ": " .htmlspecialchars($row2["clientname"]);
if ($j<=mysql_num_rows($res2)-1) $cname.="<br>";
$gname = $row2["groupname"];
$cc=$row2["clientcode"];
$type=$row2["type"];
$yr=$row2["yearend"];
$des=$row2["Description"];
$j++;
}
$message.="<tr align='center'><td>".htmlspecialchars($x)."<td
align='left'>".htmlspecialchars($gname)."<td
align='left'>".$cname."<td>".htmlspecialchars($cc)."<td>".htmlspecialchars($yr)."<td>".htmlspecialchars($type)."<td>".htmlspecialchars($des);
} //endforeach
$message.= "</table>";
$message.= "<br>";
$message.="<table width=ï`%'><tr><td>Your truly,<BR>System
Administration/Operator<td align='right'>Date:
".htmlspecialchars(date("d M Y"))."</table>";
$message.= "</body></html>";
$headers ="From: MailDaemon <maildaemon@hk.ey.com>" .
'X-Mailer: PHP/' . phpversion() . "" .
"MIME-Version: 1.0" .
"Content-Type: text/html; charset=utf-8" .
"Content-Transfer-Encoding: 8bit";

@mail($femail, "Notify of File borrowing", $message,$headers);

View Replies !
Use Another Computer To Send Mail.
My computer install Redhat and PHP and Apache I want to write script that send mail and use another computer as SMTP (specific by IP). I see in php.ini can specific SMTP but only win32.

View Replies !
How To Send E-mail With Different Sender Name?
When I used PHP to send email, the sender will always be the server name.(For example: ipl.cccu.com) Can I do something to send the email as different sender?

View Replies !
Using Templates To Send E-mail In PHP
I'm looking at sending e-mails from PHP based on templates with
expansion of variables, similar to a mail merge. Does anyone know of
existing code for this or can point me in the right direction. I
assume I will need to use regexps but am not yet sure exactly how.

View Replies !
Registration To Send Out And E-mail
I've been playing around getting my site registration to send out and e-mail, excuse the untidyness of it as I have just been playing to see what will do, What i would like to know is about what other headers I could use, or what headers I should include. PHP Code:

View Replies !
Proper Way To Send Mail
I need a good example of how to send mail using PHP. I've used the
mail() function, but I can't set the Reply-To address using it. Or can
I? So I've been using sendmail instead, but I can't seem to figure out
how to get the username in the header. Something like this:
<first last> first_last@somewhere.com

Escaping the '<>' is the problem. Also, I'd like to know how to validate
the input as this info will come from a web based form on my site and I
want to avoid the spammers.

View Replies !
Cant Send A Simple Mail From My Pc.
I cant send a simple mail from my pc. I dont know smtp server name and port of my ISP. Cant I use any other smtp server and port to send my mail. Wud u pls tell me the name as well as the port of such smtp server. Can I use yahoo's smtp server?

View Replies !
How To Send Mail With SMTP
What I want to do, is create an email form, where the user can select emails by groups from a database. So based on what group the user selects, I'm guessing I'll use SQL select query to select the appropriate user emails and print them out to the address line of the form. But I need to know the actual coding for SMTP. Is it much more complicated than the mail() function?

View Replies !
How Send SMS And MMS From Mail Server?
Does anyone know anything about sending SMS or MMS from my server (so, users could be texted that their order had been dispatched)?

I don't know where to start looking... do I need something particular installed or will it work with my normal mail server?

View Replies !
Trying To Send A Pdf As An Attachement With Mail()
I am having a bit of bother with sending a pdf as an attachment to an automated e-mail send to customers requesting  a brochure. I have the mail and attachment working but when I try to open the pdf it says it cannot recognise the filetype. I have looked around and everywhere I have looked the content type for PDF as an attachemnt is 'application/pdf'. Code:

View Replies !
Using Different Server To Send Mail..
My mail server has been blocked by a couple free e-mail providers namely Hotmail because my boss sent out an e-mail from the server to 3,000+ e-mails. Now I'm coming up with a solution so that we can continue to send e-mail to our users and new users.

I've set up a new domain on a different server but I'm trying to figure out the best way to send mail from the new server. My site sends out e-mails during user registration and few other functions.

How should I send the info to the new server so that it will send out e-mails?

For example, the website is SOMEDOMAIN.com, our new server set up soley for sending mail is SOME-DOMAIN.com. I'm thinking of adding a record to the database on SOME-DOMAIN.com any time an e-mail needs to be sent. But then how do I remotely call the script to actually send the mail. I can pass some info through the URL but should I use cURL to access the script?

View Replies !
Send Mail With Iso-8859-1
I would like to make a form which collects information from the visitors of the site, then this information is send to my email.

everything works, but the messages are sent as UTF-8 and I would like to send as iso-8859-1

I have the following piece of code in my sendmail.php file:

$mailsent = mail ($to, $subject,  $message);

My question is:
how to format variable $message as iso-8859-1 ?

View Replies !
Send Mail But No Smtp
I would like to send mail from my php script. I have all that set up etc and works when i use on a server with smtp configured, however the server i am going to use this on does not have access to any smtp server, local or remote. Are there any alternatives options that i can use or is smtp the only way?

View Replies !
Unable To Send Mail
I have a small form with 3 text fields to collect the data and send an email.
Scenario 1:

I am collecting the data from 3 fields and I am not using these 3 values. I am sending a HTML message which is good

Scenario 2:
I am collecting the data from 3 fields and appending these values in the HTML message. I am unable to send a mail from here.

In both the scenarios I was using header information also. Code:

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved