06-06-2006
Hi,
We got the solution for the sending PDF file as attachment and html as mail body from unix send mail...
I am able to open attached PDF file from my Hotmail, Yahoo id's but getting error in Gmail.com..
Error is "Adobe Reader could not open PDF file because it is either not a supported file type or because the file has been corrupted(for example, it was sent as an email attachment and wasn't correctly decoded ) "
thanks,
Nilesh
/***********Unix shell*****************************/
mailfrom=$1
#echo 'mailfrom :'$mailfrom
mailto=$2
#echo 'mailto :'$mailto
subject=$3
#echo 'subject :'$subject
content=$4
#echo 'content :'$content
attachment=$5
#echo 'attachment :'$attachment
Unixfile_Dir=$6
#echo 'Unixfile_Dir :'$Unixfile_Dir
sed_command=$7
echo 'sed_command :'$sed_command
file_name=$8
echo 'file_name :'$file_name
cd $Unixfile_Dir
(echo "MIME-Version: 1.0"
echo "From: Emirates Group Credit Control <$mailfrom>"
echo "To: $mailto"
echo "subject: $subject"
echo 'Content-Type: multipart/mixed; boundary="-"'
echo "---"
echo "Content-Type: text/html"
echo "Content-Disposition: inline"
)> XXEGHTMLFORMATFILE
(echo "---"
echo "Content-Type: application/octet-stream; name=$file_name"
echo "Content-Transfer-Encoding: x-uuencode"
echo "Content-Disposition: inline; filename=$file_name"
echo "---"
)> XXEGPDFFORMATFILE
cat $Unixfile_Dir$content | sed s/"$sed_command"/g > XXEGAR_EK_SOA_Email_NEW.htm
uuencode $attachment SOA_Attachment > SOA_Attachment
cat XXEGHTMLFORMATFILE XXEGAR_EK_SOA_Email_NEW.htm XXEGPDFFORMATFILE SOA_Attachment|sendmail $mailto
echo Done, mail sent.
/***********************************************/
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi All,
Can you please help me in solving this. I am facing some problem sending mails.
If I use like this, I am able to send mail the mail
echo "This is an automated e-mail; please do not reply." | mailx -s "Good Morning ." 'abc@xys.com'
But if I use like this, then I am unable to send... (1 Reply)
Discussion started by: manas6
1 Replies
2. Shell Programming and Scripting
How to embed a html file as subject in a mail sending from Linux box with uuencode or mailx or any other way?
we do not want the file as attachment, it should be embedded in the mail subject. (2 Replies)
Discussion started by: johnveslin
2 Replies
3. UNIX for Dummies Questions & Answers
I have written a scripts that checks the load average of server and if it is more than 5 it send a mail describing Current Load Average and High CPU/RAM processes .
The problem is I want to send these information in html form .I have done necessary coding to do the same but whenever i try to... (0 Replies)
Discussion started by: pinga123
0 Replies
4. UNIX for Dummies Questions & Answers
I have written a scripts that checks the load average of server and if it is more than 5 it send a mail describing Current Load Average and High CPU/RAM processes .
The problem is I want to send these information in html form .I have done necessary coding to do the same but whenever i try to... (7 Replies)
Discussion started by: pinga123
7 Replies
5. Shell Programming and Scripting
The below code is not working. I am able to send only inline html or only attachment. When trying to do both, only inline html is sent without attachment. Please help!
#!/bin/ksh
(echo "Subject: Test Mail - HTML Format"
echo "MIME-Version: 1.0"
echo "Content-Type: text/html"
echo... (1 Reply)
Discussion started by: thulasidharan2k
1 Replies
6. Solaris
Hi,
I am using solaris 5.9 OS and I am facing an issues with mailx.
My SMTP port is configured to listen 6190 and not the default one which is 25. I can send mail to my inbox when i do it manually through the following steps
root@<dbname> # telnet 15.12.88.10 6190
Trying 15.12.88.10...... (0 Replies)
Discussion started by: Srinathkiru
0 Replies
7. Shell Programming and Scripting
I have to send a couple of rows that have been returned from a SQL query. I have written the output of the query to a file and while i try to print this in the mail body the formatting goes wrong.
Intended Output in mail body:
Col1 Col2 Col3
------ ... (2 Replies)
Discussion started by: qwertyu
2 Replies
8. Shell Programming and Scripting
Hi All,
I am trying to send a mail from linux server but could'nt able to send the mail.
I tried the below syntax's so far but no luck.
mail -s “Hello world” abc@xyz.com < /usr/g/txt.log
cat "txt.log" | mailx -s "Hello world" abc@xyz.com
mailx -s “Hello world” abc@xyz.com <... (2 Replies)
Discussion started by: scriptscript
2 Replies
9. UNIX for Dummies Questions & Answers
I am unable to send email with attachment using the mailx command. Without the attachment, the email goes through file.
This is the command I use.
Works : $ echo "Test" | mailx -s "Test" username@website.com
Fails : $echo "Test" | mailx -a all-dss-accounts.txt -s "Test"... (3 Replies)
Discussion started by: nkarthik_mnnit
3 Replies
10. Shell Programming and Scripting
Hi,
I am trying to attach a .log file or .txt file to mail command to send an email once my ksh script executed. I am unable to use mutt command as it has been not installed and i am not supposed to install it. I have tried many ways by googling which has not helped me to succeed.
Here is my... (5 Replies)
Discussion started by: Samah
5 Replies
LEARN ABOUT CENTOS
doveadm-mount
DOVEADM-MOUNT(1) Dovecot DOVEADM-MOUNT(1)
NAME
doveadm-mount - Manage the list of mountpoints where mails are stored
SYNOPSIS
doveadm [-Dv] [-f formatter] mount command [arguments]
DESCRIPTION
The doveadm mount commands can be used to manage the list of mountpoints where mails are stored. This is used mainly for better error han-
dling when a mountpoint isn't mounted for some reason:
* If a mail directory doesn't exist, it's autocreated. If the user's mails aren't mounted and filesystem permissions still allow the
autocreation, the user will see an empty mailbox and later will have to redownload all mails. If the mountpoint is known to be
unmounted, Dovecot will simply fail opening any mailboxes.
* If dbox alternate storage isn't mounted and a mail in it is attempted to be accessed, Dovecot normally rebuilds the indexes and notices
that all the mails in alt storage are expunged. When the alt storage is mounted back and even if index is again rebuilt, the mails
won't necessarily become visible anymore for IMAP clients. If the mountpoint is known to be unmounted, Dovecot won't rebuild indexes
and lose the mails.
Dovecot automatically adds mountpoints to this list at startup. If you don't want some of the mountpoints added, you can add a wildcard
ignore for it.
OPTIONS
Global doveadm(1) options:
-D Enables verbosity and debug messages.
-f formatter
Specifies the formatter for formatting the output. Supported formatters are:
flow prints each line with key=value pairs.
pager prints each key: value pair on its own line and separates records with form feed character (^L).
tab prints a table header followed by tab separated value lines.
table prints a table header followed by adjusted value lines.
-v Enables verbosity, including progress counter.
ARGUMENTS
path The directory name of a mountpoint
state The state of a mountpoint. Either online or ignore.
COMMANDS
mount add
doveadm mount add [path [state]]
If this command is run without any parameters, doveadm detects all missing mountpoints and adds them (the same way as when Dovecot does at
startup).
When a mountpoint path is given, it's added as a mountpoint. The state can currently be either "online" (default) or "ignore". The ignore
state is mainly useful with path wildcards to add mountpoints that you never want Dovecot to automatically add, such as: doveadm mount add
'/mnt/*' ignore
mount list
doveadm [-Dv ] [-f formatter] mount list
This command lists the mountpoints known to Dovecot and their state.
mount remove
doveadm mount remove path
This command removes the specified path from the mountpoint list.
REPORTING BUGS
Report bugs, including doveconf -n output, to the Dovecot Mailing List <dovecot@dovecot.org>. Information about reporting bugs is avail-
able at: http://dovecot.org/bugreport.html
SEE ALSO
doveadm(1)
Dovecot v2.2 2012-02-16 DOVEADM-MOUNT(1)