Sponsored Content
Top Forums Shell Programming and Scripting Mailx recipient from mysql database Post 302789703 by jazzyzha on Thursday 4th of April 2013 05:23:03 AM
Old 04-04-2013
already changed the script with:

Code:
SUBJECT="TEST"
EMAIL_ADDRESS="$( mysql -uroot -pgurlia001 smsd -N -s -r -e "SELECT email FROM recipient" | tr '\n' ' ')"
mysql -uroot -pgurlia001 smsd -e "SELECT ID, SenderName, Body FROM inbox" | mailx -s "$SUBJECT" -a From:sales@acme.com "$EMAIL_ADDRESS”

output:

Code:
+ SUBJECT=TEST
+ tr \n  
+ mysql -uroot -pgurlia001 smsd -N -s -r -e SELECT email FROM recipient
+ EMAIL_ADDRESS=supervisor@gmail.com marketing@gmail.com 
daemon_emailer.sh: 15: Syntax error: Unterminated quoted string

 

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

mailx recipient restriction

maybe a simple question, but i've looked around and not been able to find anything. is there a restriction on how many recipients can be used in a single mailx command? whether it's a numeric restriction or a size restriction (like 256k for the whole recipient parameter). thanks a lot. (6 Replies)
Discussion started by: chris32680
6 Replies

2. Shell Programming and Scripting

Mailx Recipient and Name Script

Hi To All, I have a file with email addresses, most of which have names associated with them, it looks like this: http://img230.imageshack.us/img230/8255/94731317.th.jpg I am trying to come up with a script to use mailx (or anything else really) to send an email to... (4 Replies)
Discussion started by: slicker
4 Replies

3. UNIX for Dummies Questions & Answers

Connect MySQL database from Unix

How to connect a MySQL database from unix using unix shell scripting ( people are using perl scrpt to connect the same database). I want to access a MySQL database through a shell script (4 Replies)
Discussion started by: apsprabhu
4 Replies

4. Shell Programming and Scripting

How to backup a particular Database in MYSQL?

Hi All, Thanks in Advance!! How to backup a particular Databases..through Bash script!! For example i have 6 databases; Anish linux Software Questions Rhce Google these are the databases i have from that i want to take "Anish" and "questions" database backup regularly.... (4 Replies)
Discussion started by: anishkumarv
4 Replies

5. Programming

Mailx recipient from mysql database

Dear All, Can I make Mailx to read recipient address from a mysql database? I already tried emailing with bash script: SUBJECT="TEST" export EMAIL_ADDRESS=`mysql -uroot -pabcde smsd -e "SELECT email FROM recipient"` mysql -uroot -pabcde smsd -e "SELECT ID, SenderName, Body FROM inbox" |... (2 Replies)
Discussion started by: jazzyzha
2 Replies

6. Web Development

Apache users from MySQL database

Hi team, How can I implement a users in MySQL database for Apache users, assuming that I'm using RHEL6. That is to say, how can I design this database and how let's Apache server know those user in this database. Thanks in advance.. (3 Replies)
Discussion started by: leo_ultra_leo
3 Replies
SENDPAGE-DB(1p) 					User Contributed Perl Documentation					   SENDPAGE-DB(1p)

NAME
sendpage-db - manipulate Sendpage recipient database SYNOPSIS
sendpage-db [OPTIONS] OPTIONS
-c DB_TYPE Specify the database connection type (e.g. "dbi:mysql"). -U DB_USER Specify the database user to connect as (e.g. "sendpage"). -P DB_PASS Specify the database password use when connecting. -a Add an entry to the database, reading from stdin. -d Delete an entry to the database, reading from stdin. -p Show all database entries. -v Run in verbose mode. -h Display a summary of all the available command line options. DESCRIPTION
This tool is used to manipulate the recipient database that can be optionally used by Sendpage. AUTHOR
Todd T. Fries <todd@fries.net> COPYRIGHT
sendpage-db is free software; it can be used under the terms of the GNU General Public License. SEE ALSO
perl(1), sendpage(1), snpp(1) perl v5.10.0 2009-05-19 SENDPAGE-DB(1p)
All times are GMT -4. The time now is 04:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy