Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Email display not correct on Solaris 10 Post 302617905 by joeyg on Tuesday 3rd of April 2012 09:04:02 AM
Old 04-03-2012
Take a look at the following post

See this post:
How to force Sendmail to Rewrite Sender Address?
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

display driver under solaris 8

dear all : i installed solaris 8 on my PC , i am having aproblem with the display , i have an S3 savage 4 (32MB) Display adapter , i don't have its driver under solaris , any help or advises ?? (1 Reply)
Discussion started by: behmoth
1 Replies

2. Solaris

display wwpn on Solaris 2.6

Does anyone know how to find the wwpn? I have 2 dual-port hba card, having hard time finding wwpn through command lines. prtpicl isnt available - what are other commands to try? (1 Reply)
Discussion started by: kiem
1 Replies

3. Shell Programming and Scripting

Order text display not correct.

My shell script below for import data to Oracle it run okay. but the text display not correct follow order command executed. =========================Shell Script code================= #!/bin/sh #directory = ${1-'pwd'} #run import data with SQLLoader runSQLLoader() { ... (2 Replies)
Discussion started by: raccsdl
2 Replies

4. Solaris

Send an email from Solaris using Linux email server

Hello everyone I have a problem and I need your help: I have a Solaris 10 and Solaris 8 UNIX Servers, and Linux Centos4 as email server. I need send an email from Solaris servers preferably using Centos4 email server. I have no mail service configured in my Solaris computers (1 Reply)
Discussion started by: aflores
1 Replies

5. Shell Programming and Scripting

Display the content in different lines in email

Hi, I am checking if a file exists or not and based on the result I am sending an email. The email part works fine but the content of the email comes in a single line and I am not able to display it in diferent lines. if ; then echo "Hi, \\n An exception exists in the process.... (3 Replies)
Discussion started by: shanth_chandra
3 Replies

6. UNIX for Dummies Questions & Answers

Solaris 10 - DISPLAY

Hello Im having problems on re-directing the graphics from my Solaris to my PC. I can connect using reflections and get to the Solaris desktop, however, when I login and set the DISPLAY, I cannot get the screen to my PC. I run the below as root DISPLAY=192.168.0.7:0.0 ; export DISPLAY... (0 Replies)
Discussion started by: deedaz
0 Replies

7. Shell Programming and Scripting

Display both html and plain text in email in shell script

Hi, I want to display both html and plain in email in my script. i tried the below code code: export MAILTO="ssi@a.com" export CONTENT1="$htmlfile" export CONTENT2="$plainfile" export SUBJECT="INFO " export MAILFROM="si@a.com" ( echo "Subject: $SUBJECT" echo "MIME-Version:... (4 Replies)
Discussion started by: sreelu
4 Replies

8. UNIX for Advanced & Expert Users

v$sql not display correct sql_text

Hi folks, I am facing one problem with v$sql, i need to store updating sql query in temp table when one trigger get fired on some update sql statement. but with "sql_text" , i am not getting correct update statement in temp table. I am getting sql_text with this cursor statement. select... (0 Replies)
Discussion started by: apskaushik
0 Replies

9. Shell Programming and Scripting

Display calendar in correct format using shell script

Hi All, I'm trying to print calendar using shell script and i'm able to print it. But the format is not good. Here is the script. #!/bin/bash echo $(date) echo "Hello $USER" echo Hostname $(hostname) echo Working in $(pwd) echo Here is this month calender echo $(cal) $ sh first.sh... (7 Replies)
Discussion started by: chandrakanth
7 Replies

10. UNIX for Dummies Questions & Answers

Display Pie Chart/Bar Graph in microsoft outlook email using UNIX commands/Shell scripts

I have a shell script which executes to write html codes into a text file. My next step is to email the text file so that receiving person (people who i send email to) should be able to see pie/chart or bar graph (whatever i design in my code) in their email. Following is the example of a sample... (7 Replies)
Discussion started by: bikerboy
7 Replies
Email::Sender::Manual::QuickStart(3pm)			User Contributed Perl Documentation		    Email::Sender::Manual::QuickStart(3pm)

NAME
Email::Sender::Manual::QuickStart - how to start using Email::Sender right now VERSION
version 0.110005 QUICK START
Let's Send Some Mail! No messing around, let's just send some mail. use strict; use Email::Sender::Simple qw(sendmail); use Email::Simple; use Email::Simple::Creator; my $email = Email::Simple->create( header => [ To => '"Xavier Q. Ample" <x.ample@example.com>', From => '"Bob Fishman" <orz@example.mil>', Subject => "don't forget to *enjoy the sauce*", ], body => "This message is short, but at least it's cheap. ", ); sendmail($email); That's it. Your message goes out into the internet and tries to get delivered to "x.ample@example.com". In the example above, $email could be an Email::Simple object, a MIME::Entity, a string containing an email message, or one of several other types of input. If "Email::Abstract" can understand a value, it can be passed to Email::Sender::Simple. Email::Sender::Simple tries to make a good guess about how to send the message. It will usually try to use the sendmail program on unix-like systems and to use SMTP on Windows. You can specify a transport, if you need to, but normally that shouldn't be an issue. (See "Picking a Transport", though, for more information.) Also note that we imported and used a "sendmail" routine in the example above. This is exactly the same as saying: Email::Sender::Simple->send($email); ...but it's a lot easier to type. You can use either one. envelope information We didn't have to tell Email::Sender::Simple where to send the message. If you don't specify recipients, it will use all the email addresses it can find in the To and Cc headers by default. It will use Email::Address to parse those fields. Similarly, if no sender is specified, it will use the first address found in the From header. In most email transmission systems, though, the headers are not by necessity tied to the addresses used as the sender and recipients. For example, your message header might say "From: mailing-list@example.com" while your SMTP client says "MAIL FROM:<verp-1234@lists.example.com>". This is a powerful feature, and is necessary for many email application. Being able to set those distinctly is important, and Email::Sender::Simple lets you do this: sendmail($email, { to => [ $to_1, $to_2 ], from => $sender }); in case of error When the message is sent successfully (at least on to its next hop), "sendmail" will return a true value -- specifically, an Email::Sender::Success object. This object only rarely has much use. What's more useful is what happens if the message can't be sent. If there is an error sending the message, an exception will be thrown. It will be an object belonging to the class Email::Sender::Failure. This object will have a "message" attribute describing the nature of the failure. There are several specialized forms of failure, like Email::Sender::Failure::Multi, which is thrown when more than one error is encountered when trying to send. You don't need to know about these to use Email::Sender::Simple, though. All you need to know is that "sendmail" returns true on success and dies on failure. If you'd rather not have to catch exceptions for failure to send mail, you can use the "try_to_send" method, which can be imported as "try_to_sendmail". This method will return just false on failure to send mail. For example: Email::Sender::Simple->try_to_send($email, { ... }); use Email::Sender::Simple qw(try_to_sendmail); try_to_sendmail($email, { ... }); Some Email::Sender transports can signal success if some, but not all, recipients could be reached. Email::Sender::Simple does its best to ensure that this never happens. When you are using Email::Sender::Simple, mail should either be sent or not. Partial success should never occur. Picking a Transport passing in your own transport If Email::Sender::Simple doesn't pick the transport you want, or if you have more specific needs, you can specify a transport in several ways. The simplest is to build a transport object and pass it in. You can read more about transports elsewhere. For now, we'll just assume that you need to send mail via SMTP on an unusual port. You can send mail like this: my $transport = Email::Sender::Transport::SMTP->new({ host => 'smtp.example.com', port => 2525, }); sendmail($email, { transport => $transport }); Now, instead of guessing at what transport to use, Email::Sender::Simple will use the one you provided. This transport will have to be specified for each call to "sendmail", so you might want to look at other options, which follow. specifying transport in the environment If you have a program that makes several calls to Email::Sender::Simple, and you need to run this program using a different mailserver, you can set environment variables to change the default. For example: $ export EMAIL_SENDER_TRANSPORT=SMTP $ export EMAIL_SENDER_TRANSPORT_host=smtp.example.com $ export EMAIL_SENDER_TRANSPORT_port=2525 $ perl your-program It is important to note that if you have set the default transport by using the environment, no subsequent "transport" args to "sendmail" will be respected. If you set the default transport via the environment, that's it. Everything will use that transport. (Also, note that while we gave the host and port arguments above in lower case, the casing of arguments in the environment is flattened to support systems where environment variables are of a fixed case. So, "EMAIL_SENDER_TRANSPORT_PORT" would also work. This is extremely valuable behavior, as it allows you to audit every message that would be sent by a program by running something like this: $ export EMAIL_SENDER_TRANSPORT=Maildir $ perl your-program In that example, any message sent via Email::Sender::Simple would be delivered to a maildir in the current directory. subclassing to change the default transport If you want to use a library that will behave like Email::Sender::Simple but with a different default transport, you can subclass Email::Sender::Simple and replace the "build_default_transport" method. Testing Email::Sender::Simple makes it very, very easy to test code that sends email. The simplest way is to do something like this: use Test::More; BEGIN { $ENV{EMAIL_SENDER_TRANSPORT} = 'Test' } use YourCode; YourCode->run; my @deliveries = Email::Sender::Simple->default_transport->deliveries; Now you've got an array containing every delivery performed through Email::Sender::Simple, in order. Because you set the transport via the environment, no other code will be able to force a different transport. When testing code that forks, Email::Sender::Transport::SQLite can be used to allow every child process to deliver to a single, easy to inspect destination database. Hey, where's my Bcc support? A common question is "Why doesn't Email::Sender::Simple automatically respect my Bcc header?" This is often combined with, "Here is a patch to 'fix' it." This is not a bug or oversight. Bcc is being ignored intentionally for now because simply adding the Bcc addresses to the message recipients would not produce the usually-desired behavior. For example, here is a set of headers: From: sender@example.com To: to_rcpt@example.com Cc: cc_rcpt@example.com Bcc: the_boss@example.com In this case, we'd expect the message to be delivered to three people: to_rcpt, cc_rcpt, and the_boss. This is why it's often suggested that the Bcc header should be a source for envelope recipients. In fact, though, a message with a Bcc header should probably be delivered only to the Bcc recipients. The "B" in Bcc means "blind." The other recipients should not see who has been Bcc'd. This means you want to send two messages: one to to_rcpt and cc_rcpt, with no Bcc header present; and another to the_boss only, with the Bcc header. If you just pick up Bcc addresses as recipients, everyone will see who was Bcc'd. Email::Sender::Simple promises to send messages atomically. That is: it won't deliver to only some of the recipients, and not to others. That means it can't automatically detect the Bcc header and make two deliveries. There would be a possibility for the second to fail after the first succeeded, which would break the promise of a pure failure or success. The other strategy for dealing with Bcc is to remove the Bcc header from the message and then inject the message with an envelope including the Bcc addresses. The envelope information will not be visible to the final recipients, so this is safe. Unfortunately, this requires modifying the message, and Email::Sender::Simple should not be altering the mutable email object passed to it. There is no "clone" method on Email::Abstract, so it cannot just build a clone and modify that, either. When such a method exists, Bcc handling may be possible. Example Bcc Handling If you want to support the Bcc header now, it is up to you to deal with how you want to munge the mail and inject the (possibly) munged copies into your outbound mailflow. It is not reasonable to suggest that Email::Sender::Simple do this job. Example 1: Explicitly set the envelope recipients for Bcc recipients Create the email without a Bcc header, send it to the Bcc users explicitly and then send it to the To/Cc users implicitly. my $message = create_email_mime_msg; # <- whatever you do to get the message $message->delete_header('bcc'); # delete the Bcc header before sending sendmail($message, { to => $rcpt' }); # send to explicit Bcc address sendmail($message); # and then send as normal Example 2: Explicitly set the envelope recipients for all recipients You can make a single call to "sendmail" by pulling all the recipient addresses from the headers yourself and specifying all the envelope recipients once. Again, delete the Bcc header before the message is sent. SEE ALSO
This is awesome! Where can I learn more? Have a look at Email::Sender::Manual, where all the manual's documents are listed. You can also look at the documentation for Email::Sender::Simple and the various Email::Sender::Transport classes. AUTHOR
Ricardo Signes <rjbs@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Ricardo Signes. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-03-06 Email::Sender::Manual::QuickStart(3pm)
All times are GMT -4. The time now is 05:22 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy