Sponsored Content
Full Discussion: e-mail script
Top Forums Shell Programming and Scripting e-mail script Post 22152 by LivinFree on Wednesday 29th of May 2002 12:25:01 AM
Old 05-29-2002
Well, typically you'll get more help if you get the ball rolling, and ask about specific areas Smilie

A few hints, though:
man test
man (your shell here - look for the "if" statements in the page)
man mail

Also a hint: You can use "here-docs" for mail - I use this method:
/usr/bin/mail my.address@example.com <<EOF
Subject: Hello
Importance: Low

This is my body. Above is the header.


Play with it, and post back if you have any specific problems...

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

I need a script that script extract info from mail

Hello, I receive email once an hour that looks like: subject line: dialin body: ip address ip address . . sometimes the body has no ip address in it(blank mail) I want a script that will send to my email every 12 hours the ip numbers and the time and data something like: data,... (1 Reply)
Discussion started by: meravd
1 Replies

2. UNIX for Dummies Questions & Answers

Mail Script need Help???

Hi I have written the folowing mail function: SENDMAIL () { mailx -r 'Team' -s ' QA Test & Work Build & Deployment ---> STARTED' $INTERESTED<<EOF Maintenance is going on $path in 10 Minutes. So Please exit the Accounts EOF return } Above is working fine for me.. The... (2 Replies)
Discussion started by: gkrishnag
2 Replies

3. Solaris

how to forward mail in /var/mail/username to external mail

Dear All, Now I use solaris 10 and I try to forward mail from /var/mail/username to their external mail so what should I do? thank u in advance (2 Replies)
Discussion started by: unitipon
2 Replies

4. Shell Programming and Scripting

script to read mail on a mail server

Hi All, Is there any way Unix shell script can directly read a mail on a mail server (for eg. abc@xyz.com) and save it as a text file in a unix directory ? Thanks PRKS ---------- Post updated at 08:37 AM ---------- Previous update was at 08:36 AM ---------- I am using ksh (1 Reply)
Discussion started by: PRKS
1 Replies

5. UNIX for Advanced & Expert Users

need to configure mail setting to send mail to outlook mail server

i have sun machines having solaris 9 & 10 OS . Now i need to send mail from the machines to my outlook account . I have the ip adress of OUTLOOK mail server. Now what are the setting i need to do in solaris machines so that i can use mailx or sendmail. actually i am trying to automate the high... (2 Replies)
Discussion started by: amitranjansahu
2 Replies

6. Shell Programming and Scripting

mail script

Hi.. I need to create a script which will send a mail with attached file of log whenever its invoked with some text in its body. (Using Sendmail) I don't have any idea regarding that. any one help me out with this. Thanks, (1 Reply)
Discussion started by: sukhdip
1 Replies

7. Shell Programming and Scripting

script with mail

hello , what is wrong in this script ? #!/bin/bash limite=3 while ; do if ; then pru=/usr/bin/mei.txt cat $pru | mail -s "IMEIS" account@domain.com fi (15 Replies)
Discussion started by: academico69
15 Replies

8. Shell Programming and Scripting

Mail script

Hi Folks Please help me on the below script I want to write a script to mail with the subject as "xxxxx" on (lastday-1)_month_year. means for this month the subject is like "xxxx" on 30_jan_2013 for february the subject is like "xxxx" on 27_feb_2013 only the subject needs to change,... (3 Replies)
Discussion started by: coolboy98699
3 Replies

9. Shell Programming and Scripting

A shell script to run a script which don't get terminated and send a pattern from the output by mail

Hi Guys, I am very new to shell script and I need your help here to write a script. Actually, I have a script abc.sh which don't get terminated itself. So I need to design a script to run this script, save the output to a file, search for a given string in the output and if it exists send those... (11 Replies)
Discussion started by: Sambit Sahu
11 Replies

10. UNIX for Advanced & Expert Users

Client was not authenticated to send anonymous mail during MAIL FROM (in reply to MAIL FROM comm

I am having trouble getting mail to work on a red hat server. At first I was getting this message. Diagnostic-Code: X-Postfix; delivery temporarily suspended: connect to :25: Connection refused Then added the port to my firewall. Then I temporarily turned off selinux. I then copied this file... (1 Reply)
Discussion started by: cokedude
1 Replies
XDG-EMAIL(1)															      XDG-EMAIL(1)

xdg-email - command line tool for sending mail using the user's preferred e-mail composer SYNOPSIS
xdg-email [--utf8] [--cc address] [--bcc address] [--subject text] [--body text] [--attach file] [mailto-uri address(es)] xdg-email {--help --manual --version} DESCRIPTION
xdg-email opens the user's preferred e-mail composer in order to send a mail to address(es) or mailto-uri. RFC2368 defines mailto: URIs. xdg-email limits support to, cc, subject and body fields in mailto-uri, all other fields are silently ignored. address(es) must follow the syntax of RFC822. Multiple addresses may be provided as separate arguments. All information provided on the command line is used to prefill corresponding fields in the user's e-mail composer. The user will have the opportunity to change any of this information before actually sending the e-mail. xdg-email is for use inside a desktop session only. It is not recommended to use xdg-email as root. See http://portland.freedesktop.org/EmailConfig for information on how the user can change the e-mail composer that is used. OPTIONS
--utf8 Indicates that all command line options that follow are in utf8. Without this option, command line options are expected to be encoded according to locale. If the locale already specifies utf8 this option has no effect. This option does not affect mailto URIs that are passed on the command line. --cc address Specify a recipient to be copied on the e-mail. --bcc address Specify a recipient to be blindly copied on the e-mail. --subject text Specify a subject for the e-mail. --body text Specify a body for the e-mail. Since the user will be able to make changes before actually sending the e-mail, this can be used to provide the user with a template for the e-mail. text may contain linebreaks. --attach file Specify an attachment for the e-mail. file must point to an existing file. Some e-mail applications require the file to remain present after xdg-email returns. --help Show command synopsis. --manual Show this manualpage. --version Show the xdg-utils version information. ENVIRONMENT VARIABLES
xdg-email honours the following environment variables: XDG_UTILS_DEBUG_LEVEL Setting this environment variable to a non-zero numerical value makes xdg-email do more verbose reporting on stderr. Setting a higher value increases the verbosity. EXIT CODES
An exit code of 0 indicates success while a non-zero exit code indicates failure. The following failure codes can be returned: 1 Error in command line syntax. 2 One of the files passed on the command line did not exist. 3 A required tool could not be found. 4 The action failed. 5 No permission to read one of the files passed on the command line. CONFIGURATION
Visit http://portland.freedesktop.org/EmailConfig for information how to configure xdg-email to use the email client of your choice. EXAMPLES
xdg-email 'Jeremy White <jwhite@example.com>' xdg-email --attach /tmp/logo.png --subject 'Logo contest' --body 'Attached you find the logo for the contest.' 'jwhite@example.com' xdg-email --subject 'Your password is about to expire' 'jwhite@example.com' 'bastian@example.com' 'whipple@example.com' AUTHOR
Kevin Krammer, Jeremy White. <kevin.krammer@gmx.at> <jwhite@codeweavers.com> xdg-utils 1.0 06/24/2007 XDG-EMAIL(1)

Featured Tech Videos

All times are GMT -4. The time now is 01:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy