Monday, September 7, 2009

Sending Email Through Unix (HP-UX)

Environment: HP-UX
Application Version: 12.0.6

The below is the code to send mail with attachment from unix:

mailx -s "Subject" to_mail_address

example:
mailx -s "Summary Report" anto.natesh@abc.com

Here,
mailx: is a utility to sending email from unix.
-s: denoting as subject
"Summary Report" - Subject of the email
anto.natesh@abc.com - to address

The below is the code to send mail with attachment from unix:

uuencode "File_Name" "New_File_Name") | mailx -s "Subject" to_mail_address

Example:
uuencode "abcd.pdf" "summary_report.pdf") | mailx -s "Summary Report" anto.natesh@abc.com

Here,

uuencode: Unix to Unix Encoding, is basically used to send a mail with attachment.
abcd.pdf: Original File Name to send over mail.
summary_report.pdf: New Name
|: Pipe symbol to execute 2 statement from one line.

I will explain how to create and use this functionality as a concurrent program in oracle applications.

If you need any clarifications, mail me @ anto.natesh@gmail.com

No comments: