Sponsored Content
Top Forums Shell Programming and Scripting Auto emails from within the program Post 303021162 by nobbyall on Monday 6th of August 2018 02:46:25 AM
Old 08-06-2018
Hi RudiC,
Thank you for taking the trouble to reply to my very vague posting.

This build system was originally written on a Linux/GNU system.

# !/bin/bash

Really back to basics for me but pleased to have it running albeit with a few niggles.

------ Post updated 08-06-18 at 01:44 AM ------


This is the email coding that I use to send individual emails but for some reason it will not let me select the email I wish to send.
I thought it was just a question of removing the hashtag and voila?

Code:
# !/bin/bash

# Email Creation
# Make sure the file contains only one message and is "compacted"...
# Make sure that a dummy attachment was done, if applicable
# Slice this off, just after the end of the main message.

# NB FileSpec (See below) items are looked for within the user's subdir ONLY...
# This means that CollectUserFiles may need to be re-run before CreateEmails
# i.e. Files MUST have already been collected by ./conv08

# Attachments
# Mode : NoAttach  # The default if none specified...
# Mode : Auto      # Attach the "FileSpec" files from the Users sub-directories
# FileSpec :       # The default is '*' if none specified...
# DON'T HAVE _ (Underscore) Characters in any file names (messes with sed)...
# Ditto spaces, they can be a pain in the backside...

clear

#emlFileName="FileName[:Mode[:FileSpec]]"
#emlFileName="$EmailDir/00-Initial.eml:Auto:*.png"
#emlFileName="$EmailDir/00-Intro.eml:Auto"
#emlFileName="$EmailDir/01-Added-To-List.eml"
#emlFileName="$EmailDir/01-Follow-Up.eml"
#emlFileName="$EmailDir/02-Intro-No-Reply.eml"
#emlFileName="$EmailDir/02-Opt-In.eml"
#emlFileName="$EmailDir/02-Opt-In-Final.eml"
#emlFileName="$EmailDir/02-Opt-In-No-Reply.eml"
#emlFileName="$EmailDir/02-Removed-From-List.eml"
#emlFileName="$EmailDir/03-Diagrams-Offer.eml"
#emlFileName="$EmailDir/04-Diagrams-Added.eml:Auto:Diagrams*.pdf"
#emlFileName="$EmailDir/04-Diagrams-SentLate.eml:Auto:Diagrams*.pdf"
#emlFileName="$EmailDir/04-Intro-MakeIB.eml:Auto:*MakeIB*"
#emlFileName="$EmailDir/04-Intro-P-Swap.eml:Auto"
#emlFileName="$EmailDir/20-Latest.eml:Auto"
#emlFileName="$EmailDir/20-Latest-Delayed.eml"
#emlFileName="$EmailDir/20-Latest-Req-Feedback.eml"
#emlFileName="$EmailDir/20-LinkMove.eml:Auto"
#emlFileName="$EmailDir/30-DiaryEntries.eml:Auto:Help.Add-DE.txt;*.DE*"
#emlFileName="$EmailDir/31-DiaryEntries-PreInstalled.eml:Auto:*.ods"
#emlFileName="$EmailDir/99-GenericReUseMe.eml"
#emlFileName="$EmailDir/99-HandOver.eml"
#emlFileName="$EmailDir/99-Shell-No-Attach.eml"


#UserListFileName="$UserListFileName.unconfirmed"

LessUsers=0 # Bodge to change the count value, if necessary...
TotalUsers=$((TotalUsers-LessUsers))

if [ -z "$emlFileName" ]; then
  ERROR "No emlFileName selected..."
  exit 1
fi

if [ "$OSdetected" = "Linux" ]; then
  hostname="$HOSTNAME"
else

  # ... on a Mac, this may get appended with .local or .lan (LAN)
  hostname="`echo $HOSTNAME | cut -d '.' -f1`" 
fi

hostname=z

if [ ! "$hostname" = "main-pc" ] && [ ! "$hostname" = "irh-macbook" ]; then
  echo "${ATTRBOLD}##########################################################################${ATTRCLEAR} " 
  echo ""

  WARNING "hostname \"$hostname\" Has not been recognised and has been re-assigned the name \"deputy\""
  hostname="deputy"
fi

 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

auto startup of a program

how do i make a program run at system startup? is there a hirarchy i have to consider? is there any equivalent to an NT "Service" in unix? how do you set it up? thanx Ron (2 Replies)
Discussion started by: exoron
2 Replies

2. UNIX for Dummies Questions & Answers

how to capture bounced emails

Hi, I use mailx to send short notifications to a bunch of users ( in Lotus Notes ). The undeliverable emails are going to the Notes' Dead Letter basket and creating a problem. I am told by the Notes Admin that I need to specify a 'Return address' so that the bounced emails can go there. I can not... (1 Reply)
Discussion started by: ray1972
1 Replies

3. UNIX for Dummies Questions & Answers

Creating emails

Hi, I posted here 2 months ago, saying I wanted to learn UNIX for my work running a small ISP. I had the problem of practically no technical support for our system. Many courses later, I can just about do everything I need to do. The server is a FreeBSD i386. I can now create email accounts for... (4 Replies)
Discussion started by: ferret495
4 Replies

4. UNIX for Dummies Questions & Answers

duplicate emails

Hi all new here. Question. My mail server is sending out duplicate emails but its not system wide. We have several virtual host that use our email server and some are having the duplicate emails issue and some are not. For example in the office some people are getting duplicate emails but i am... (1 Reply)
Discussion started by: mcraul
1 Replies

5. UNIX for Dummies Questions & Answers

Emails on HP-UX

Hi Guys I am running Oracle database on HP-UX, every now and then I get emails that are sent to me by root. When check with the sysadmin know one have a clue as to where does the emails come from. I need to stop this emails...how do I check which script is sending me the emails. Thanks ... (0 Replies)
Discussion started by: Phuti
0 Replies

6. Programming

Sending emails in C program for multiple machines on Linux/OSX

Hey guys, i am creating a tool that'll run a couple network test, generate a report then email the report. Now i a bit stuck with the email sending part... I tried at first a script which worked on some machines but then it'll work fine on some machine and act up on others... I can't really rely... (2 Replies)
Discussion started by: Jess83
2 Replies

7. UNIX for Dummies Questions & Answers

send emails

hi guys I need to send emails to some accounts 1. I need sendmail up and running right? 2. I need my local sendmail to use an existing SMTP server to send emails (10.x.x.x)? in that case what I need to configure to send emails? since using mail myaccount@companyame.com is not sending emails... (3 Replies)
Discussion started by: karlochacon
3 Replies

8. Solaris

Emails issue

Dear all, I am facing an issue in my data Center environment related to mails being generated by users on my machines. Let me walk you through the issue one by one. Each system (100+ servers in my DC) has a user sysmon on it that sends mails to a specific Email ID. The user runs scripts... (8 Replies)
Discussion started by: Junaid Subhani
8 Replies

9. UNIX for Beginners Questions & Answers

Howto auto boot SPARC | How to auto supply "start /SYS" and "start /SP/console" commands

When I power ON my T4-1, I got a prompt -> where I have to start /SYS and start /SP/console. How can I auto supply these two commands ? (3 Replies)
Discussion started by: z_haseeb
3 Replies
BBCODE_SET_FLAGS(3)							 1						       BBCODE_SET_FLAGS(3)

bbcode_set_flags - Set or alter parser options

SYNOPSIS
bool bbcode_set_flags (resource $bbcode_container, int $flags, [int $mode = BBCODE_SET_FLAGS_SET]) DESCRIPTION
Set or alter parser options PARAMETERS
o $bbcode_container - BBCode_Container resource, returned by bbcode_create(3). o $flags - The flag set that must be applied to the bbcode_container options o $mode - One of the BBCODE_SET_FLAGS_* constant to set, unset a specific flag set or to replace the flag set by flags. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 bbcode_set_flags(3) usage example <?php /* * Preparing RuleSet */ $arrayBBCode=array( 'b'=> array('type'=>BBCODE_TYPE_NOARG, 'open_tag'=>'<b>', 'close_tag'=>'</b>'), 'u'=> array('type'=>BBCODE_TYPE_NOARG, 'open_tag'=>'<u>', 'close_tag'=>'</u>'), 'i'=> array('type'=>BBCODE_TYPE_NOARG, 'open_tag'=>'<i>', 'close_tag'=>'</i>'), ); /* * Paired incorrectly nested BBCode */ $text="[i] Parser [b] Auto Correction [/i] at work [/b] "; $BBHandler=bbcode_create($arrayBBCode); echo bbcode_parse($BBHandler,$text); // Enabling reopening of automatically closed elements bbcode_set_flags($BBHandler,BBCODE_CORRECT_REOPEN_TAGS, BBCODE_SET_FLAGS_SET); echo bbcode_parse($BBHandler,$text); /* * Unpaired incorrectly nested BBCode */ $text="[i] Parser [b] Auto Correction [/i] at work "; echo bbcode_parse($BBHandler,$text); // Enabling automatic close of pending tags bbcode_set_flags($BBHandler, BBCODE_CORRECT_REOPEN_TAGS|BBCODE_AUTO_CORRECT, BBCODE_SET_FLAGS_SET); echo bbcode_parse($BBHandler,$text); ?> The above example will output: <i> Parser <b> Auto Correction </b></i> at work <i> Parser <b> Auto Correction </b></i><b> at work </b> <i> Parser [b] Auto Correction </i> at work <i> Parser <b> Auto Correction </b></i><b> at work </b> PHP Documentation Group BBCODE_SET_FLAGS(3)
All times are GMT -4. The time now is 11:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy