04-26-2013
Q: grab email username from script
Hi all,
I want to set up a script to email a person to confirm another program is running but i wish to avoid having to customise the script for each individiual.
I am ok with what i need to do except i need to get the first and last name of the user to construct an email address to send to. The username variable and associated grep routines are not possible to use as they do not return anything. All i can get is the userid whch they log in with.
I feel the best way would be to grab the last and first names as set up in their email. Is there a way of using a script to return this info? I cannot assume they have sent or received emails either so i would need the info pulled from their settings
Thank you in advance for any assistance rendered.
3 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi guys
say I have a file that contains
hello
world
this
is
AAAAA
message
to
try
BBBBBB
and
see
if
anyone
AAAAA
knows
the (3 Replies)
Discussion started by: JamesByars
3 Replies
2. Shell Programming and Scripting
#!/bin/sh
who
echo "\r"
echo Enter the terminal ID of the user in use:
echo "\r"
read TERM_ID
echo "\r"
ps -t $TERM_ID | grep sh
echo "\r"
echo Enter the process number to end:
echo "\r"
read PID
echo "\r"
kill -9 $PID
What this code does is ultimately grab the PID of a users sh... (6 Replies)
Discussion started by: psytropic
6 Replies
3. Shell Programming and Scripting
How do I capture an error for any command I use.
For e.g if i try to zip a file and the file is not there. The regualr $? -gt 0 only tells its un-successful but won't tell me that the file is not there when I run through a script. How can I capture this error?
for e.g.. zip $x.zip $x... (1 Reply)
Discussion started by: dsravan
1 Replies
LEARN ABOUT DEBIAN
mail::verify
Mail::Verify(3pm) User Contributed Perl Documentation Mail::Verify(3pm)
NAME
Mail::Verify - Utility to verify an email address
SYNOPSIS
use Mail::Verify;
DESCRIPTION
"Mail::Verify" provides a function CheckAddress function for verifying email addresses. First the syntax of the email address is checked,
then it verifies that there is at least one valid MX server accepting email for the domain. Using Net::DNS and IO::Socket a list of MX
records (or, falling back on a hosts A record) are checked to make sure at least one SMTP server is accepting connections.
ERRORS
Here are a list of return codes and what they mean:
0 The email address appears to be valid.
1 No email address was supplied.
2 There is a syntaxical error in the email address.
3 There are no DNS entries for the host in question (no MX records or A records).
4 There are no live SMTP servers accepting connections for this email address.
EXAMPLES
This example shows obtaining an email address from a form field and verifying it.
use CGI qw/:standard/;
use Mail::Verify;
my $q = new CGI;
[...]
my $email = $q->param("emailaddr");
my $email_ck = Mail::Verify::CheckAddress( $email );
if( $email_ck ) {
print '<h1>Form input error: Invalid email address.</h1>';
}
[...]
perl v5.8.8 2002-06-09 Mail::Verify(3pm)