How to send html messages using unix mail ?

Hi,
I'm wondering if it's possible to send html formated mail using Unix mail command ?
Regards,
Didier.

It works fine for me right out of the box; I've done zero to configure anything. In my case, I presume the HTML is encoded in a file. Then I invoke a script which adds the following mail headers before the HTML, then calls sendmail:
<pre class=command>MIME-Version: 1.0
Content-type: text/html; charset=ISO-8859-1
To: $address
From: $MY_EMAIL
Subject: File: $subject
</pre>
In the header, variables $address, $MY_EMAIL, and $subject are filled in by the shell script.
HTH

Similar Messages

  • How to send picture message using J2ME sms APIs?

    Hi,
    I experiment with SMS APIs, i successfully send simple text message. now i want to send picture message, how to send picture message using J2ME APIs.
    please guide me.
    guna.

    I experienced in coding sending and receiving sms in J2ME. Besides, I also esperienced in coding reading a binary file in a applicaition jar. But I never done these both together. Hence Im not sure it works or not. Below is the example to open and read a binary file:
    InputStream oInputStream = getClass().getResourceAsStream( "/picture.png" );
    if(oInputStream == null) {
    //File does not exist;
    throw new Exception("File not found");
    //Read the binary file and copy it to a byte array
    byte[] abyPicture = new byte[oInputStream.available()];
    oInputStream.read(abyPicture );

  • How to send text messages using my Laptop

    How to send text messages written on my Laptop on my Curve8520 with Orange network?

    umm... you don't. SMS is a function of the BlackBerry, not your PC.
    There could a desktop software for SMS, but I don't know what it would be.
    **edit, well this looks like it would work.
    http://download.cnet.com/Desktop-SMS/3000-10440_4-​10340430.html
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How to send Html message in this procedure?

    Hi all,
    here is one procedure
    DECLARE
    v_connection UTL_SMTP.CONNECTION;
    BEGIN
    v_connection := UTL_SMTP.OPEN_CONNECTION('mail.idealake.com',25);
    UTL_SMTP.HELO(v_connection,'mail.idealake.com');
    UTL_SMTP.MAIL(v_connection,'[email protected]');
    UTL_SMTP.RCPT(v_connection,'[email protected]');
    UTL_SMTP.DATA(v_connection,'Sent From PL/SQL');
    UTL_SMTP.QUIT(v_connection);
    END;
    I want to send html message throug this procedure.
    Please tell me tjhe solution.
    Thanks in advance.
    Prathamesh.

    I also have a copy of send mail package (modified copy of some code that I found on the net). Originally written with utl_smtp. Converted it to utl_tcp. Supports binary file attachments and formatted html messages now.
    You can pick it up at my website... http://www.myoracleportal.com

  • How to send multiple Recipients using the mail.jar and activation.jar

    hi!
    could somebody help me. how do i send multiple Recipient using mail.jar. when i would input 2email address in to Recipient
    (example: [email protected], [email protected])
    i get a DEBUG: setDebug: JavaMail version 1.3.2
    but if i send a single email it just works properly.
    heres my code
    import java.io.*;
    import java.util.*;
    import javax.mail.*;
    import javax.mail.event.*;
    import javax.mail.internet.*;
    public class SendMail
              public SendMail(String to, String from, String subject, String body)
              //public SendMail(String to)
                   String message_recip = to;
                   String message_subject = subject;
                   String message_cc = "";
                   String message_body = body;
                   //The JavaMail session object
                   Session session;
                   //The JavaMail message object
                   Message mesg;
                   // Pass info to the mail server as a Properties, since JavaMail (wisely) allows room for LOTS of properties...
                   Properties props = new Properties( );
                   // LAN must define the local SMTP server as "mailhost" to be able to send mail...
                   //props.put("mail.smtp.host","true");
                   props.put("mail.smtp.host", "mailhost");
                   // Create the Session object
                   session = Session.getDefaultInstance(props, null);
                   session.setDebug(true);
                   try
                        // create a message
                        mesg = new MimeMessage(session);
                        // From Address - this should come from a Properties...
                        mesg.setFrom(new InternetAddress(from));
                        // TO Address
                        InternetAddress toAddress = new InternetAddress(message_recip);
                        mesg.addRecipient(Message.RecipientType.TO, toAddress);
                        // CC Address
                        InternetAddress ccAddress = new InternetAddress(message_cc);
                        mesg.addRecipient(Message.RecipientType.CC, ccAddress);
                        // The Subject
                        mesg.setSubject(message_subject);
                        // Now the message body.
                        mesg.setText(message_body);
                        // XXX I18N: use setText(msgText.getText( ), charset)
                        // Finally, send the message!
                        Transport.send(mesg);
                   }//end of try
                   catch (MessagingException ex)
                        while ((ex = (MessagingException)ex.getNextException( )) != null)
                             ex.printStackTrace( );
                        }//end of while
              }//end of catch
         }//end of SendMail
    public static void main(String[] args)
              //String t = "[email protected], [email protected]"; - this I think causes error
    String t = "[email protected]";
              String f = "[email protected]";
              String s = "Hello World";
              String b = "the quick brown fox jumps over the lazy dog";
              SendMail sm = new SendMail(t,f,s,b);     
         }//end of main
    }//end of class
    could someone please help me im stuck-up with this. thanx!

    i need it ASAP
    i am a beginner in java and jsp
    Need to knw how can I parse the addresss field
    Below
    is the code
    <code>
    package
    public class EMailBean {
    private String smtp,username,password,from,bcc,subject,body,attachments,cc;
         /*setter*/
         public void setSmtp(String str){this.smtp=str;}
         public void setUsername(String str){this.username=str;}
         public void setPassword(String str){this.password=str;}
         public void setFrom(String str){this.from=str;}
         public void setTo(String str){this.to=str;}
         public void setCc(String str){this.cc=str;}
         public void setBcc(String str){this.bcc=str;}
         public void setSubject(String str){this.subject=str;}
         public void setBody(String str){this.body=str;}
         public void setAttachments(String str){this.attachments=str;}
                                  /*getter*/
         public String getSmtp( ){return this.smtp;}
         public String getUsername( ){return this.username;}
         public String getPassword( ){return this.password;}
         public String getFrom( ){return this.from;}
         public String getTo( ){return this.to;}
         public String getCc( ){return this.cc;}     
         public String getBcc( ){return this.bcc;}
         public String getSubject( ){return this.subject;}
         public String getBody( ){return this.body;}
    public String getAttachments( ){return this.attachments;}
    </code>
    Session session = Session.getDefaultInstance(props, null);
    session.setDebug(true);
    try {
    MimeMessage msg = new MimeMessage(session);
    msg.setFrom(new InternetAddress(mail.getFrom()));
                                  msg.addRecipients(Message.RecipientType.TO, InternetAddress.parse(to, false));
                                  msg.addRecipient(Message.RecipientType.TO,new InternetAddress(mail.getTo()));
                             msg.addRecipient(Message.RecipientType.CC, new InternetAddress(mail.getCc()));
                                  msg.addRecipient(Message.RecipientType.CC, new InternetAddress("[email protected]"));
    msg.setSubject(mail.getSubject());
    // Create the message part
    BodyPart messageBodyPart = new MimeBodyPart();
    // Fill the message
    messageBodyPart.setText(mail.getBody());
    Multipart multipart = new MimeMultipart();
    multipart.addBodyPart(messageBodyPart);
    // Part two is attachment
    messageBodyPart = new MimeBodyPart();
    DataSource source = new FileDataSource(mail.getAttachments());
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(source.getName());
    multipart.addBodyPart(messageBodyPart);
    msg.setContent(multipart);
    msg.setSentDate(new Date());
    Transport t = session.getTransport("smtp");
    try {
    t.connect(mail.getUsername(), mail.getPassword());
    t.sendMessage(msg, msg.getAllRecipients());
    } finally {
    t.close();
    result = result + "<FONT SIZE='4' COLOR='blue'><B>Success!</B>"+"<FONT SIZE='4' COLOR='black'> "+"<HR><FONT color='green'><B>Mail was successfully sent to </B></FONT>: "+mail.getTo()+"<BR>";
    if (!("".equals(mail.getCc())))
    result = result +"<FONT color='green'><B>CCed To </B></FONT>: "+mail.getCc()+"<BR>";
    if (!("".equals(mail.getBcc())))
    result = result +"<FONT color='green'><B>BCCed To </B></FONT>: "+mail.getBcc() ;
    result = result+"<BR><HR>";
    } catch (MessagingException mex) {
    result = result + "<FONT SIZE='4' COLOR='blue'> <B>Error : </B><BR><HR> "+"<FONT SIZE='3' COLOR='black'>"+mex.toString()+"<BR><HR>";
    } catch (Exception e) {
    result = result + "<FONT SIZE='4' COLOR='blue'> <B>Error : </B><BR><HR> "+"<FONT SIZE='3' COLOR='black'>"+e.toString()+"<BR><HR>";
    e.printStackTrace();
    finally {
    return result;
    }

  • How to receive HTML email using JAVA Mail API?

    Hello!
    I am developing WEB Mail System. There is a little problem. I am unable to receive mail in HTML format. The mail is being received in only text format currently. What method do i need to use to achieve this functionality currently i am using
    MimeMessage message = mail.getMessage();
    if(message.isMimeType("text/plain")){
    String str_message_body = message.getContent().toString();
    else
    Multipart multipart = (Multipart)message .getContent();
    Kindly advise me regarding that because i am in a state of fix right now and unable to proceed further.
    I will really appreciate a prompt response from you.
    Regards,
    Burhan Ramay.

    HTML is a text format too, so you do
    if(message.isMimeType("text/html")){
    String str_message_body = message.getContent().toString();
    }

  • How to Send Html Email using JavaMail?

    I want to send email message body as html.
    as some news sites send.What will easiest way of doing that?

    oops!!!
    Sorry there is one more thing in it the ByteArrayDataSource class. I am posting the code in the class here. Compile it in a separate class.
    class ByteArrayDataSource implements DataSource
        private byte[] data;     // data
        private String type;     // content-type
        /* Create a DataSource from an input stream */
        public ByteArrayDataSource(InputStream is, String type)
            this.type = type;
            try
                ByteArrayOutputStream os = new ByteArrayOutputStream();
                  int ch;
                  while ((ch = is.read()) != -1)
                // XXX - must be made more efficient by
                 // doing buffered reads, rather than one byte reads
                 os.write(ch);
                  data = os.toByteArray();
            } catch (IOException ioex) { }
        /* Create a DataSource from a byte array */
        public ByteArrayDataSource(byte[] data, String type)
            this.data = data;
              this.type = type;
        /* Create a DataSource from a String */
        public ByteArrayDataSource(String data, String type)
              try
             // Assumption that the string contains only ASCII
             // characters!  Otherwise just pass a charset into this
             // constructor and use it in getBytes()
             this.data = data.getBytes("iso-8859-1");
              catch (UnsupportedEncodingException uex)
              this.type = type;
         * Return an InputStream for the data.
         * Note - a new stream must be returned each time.
        public InputStream getInputStream() throws IOException
              if (data == null)
                  throw new IOException("no data");
              return new ByteArrayInputStream(data);
        public OutputStream getOutputStream() throws IOException
              throw new IOException("cannot do this");
        public String getContentType()
            return type;
        public String getName()
            return "dummy";
    }hope this will help
    best wishes
    khuda hafiz

  • How to send Encrypted message using public key in Business Service

    Hi,
    I have one public key (abc.cer) which is given by provider. I have to send encrypted message to Provider using public key. How to achieve it in OSB??
    Thanx
    Edited by: Vinit Ahuja on Jun 16, 2011 3:17 AM

    These are the steps needed to accomplish this:
    1. Import the public certificate in the TrustStore of the OSB Weblogic Server.
    2. Export the public certificate in PEM format. (This will be needed to embed in the custom ws policy)
    3. Create a custom WS policy, with the necessary encryption configuration information. I have placed a sample WS - Policy that I have used @ http://dl.dropbox.com/u/19901533/Sample_Custom_WSPolicy_Encryption.doc for your reference.
    Use a unique value for the wsu:Id in the policy.
    4. Apply this custom policy on the business service in the Request section (assuming you only need to encrypt the request fields)
    5. Activate the changes and then test the business service. You can enable tracing on the BS to validate the encrypted content in the logs.
    Hope this helps.
    Thanks,
    Patrick

  • HT4111 how to send a message using bluetooth keyboard in imessage

    is there any way to send a message in iMessage from my iPad mini using the bluetooth keyboard?

    I've got it connected and everything, but I want to know how I actually send the written txt without tapping "send" on the iPad. Is there any way to do it from the keyboard? Hitting "enter" just takes the cursor down to the next line.

  • How to send HTML email using alert framework? Kindly help!

    Hi Experts,
          I am using alert framework (alert category) to send email. In the email message I want to use HTML content along with some hyperlinks.
         How can I do this?
         kindly help!
    Thanks
    Gopal
    Message was edited by:
            gopalkrishna baliga

    Hi,
    To send hyper links, you can add the links in the FollowUp Activity.
    The content of the mail from the alert framework will be a text mail.
    One option would be to check in your SCOT settings if it would be possible to set the Content Type as TEXT/HTML . If yes, then maybe this should be possible.
    Regards
    Bhavesh

  • How to send error message via a mail to the customers email id

    HI experts ,
    i have a requirement,In idoc where i have to send the error message via email to a perticular emailid?
    please help me n tell also which fm is used for that?
    Thanks
    RAhul Sisodia

    Hi ,
    Check this Link..
    [sending an email with multiple attachments;
    Regards,
    Sachin M M

  • How to send secure email using JavaMail

    Hi, anyone out there know how to send secure email using Java Mail? Greately appreciated.

    For starters, if you have not already done so, read about it in the JavaMail design specifications.
    Search for Message Security in the said document.

  • I have an iMac, and have a Verizon DSL account. Recently, my Mac Mail keeps requesting the passwords on my account every few minutes, and will not allow me to send messages using Mac Mail. I cannot edit the outgoing server; how can I send emails?

    I have an iMac, and have a Verizon DSL account (3 email addresses). Recently, my Mac Mail keeps requesting the passwords on my accounts every few minutes, and will not allow me to send messages using Mac Mail (the message says that the outgoing server was rejected. I cannot edit the outgoing server, and the keychain will not save my passwords (the ports are valid). How can I change the outgoing server to send emails, and how can I avoid having Mail request my passwords every 2 minutes? Verizon, as usual, will not provide support to iMacs.

    Is there an email saved in your drafts or outbox folder?  I suspect that Mail is continually trying to send it, and each time Google is rejecting the email message.
    You can open the message and then delete it from your Outbox folder.  Then try removing all @gmail email addresses from it and seeing whether you can send to the other folks.  I suspect that will work.
    With email, if an SMTP server *can* verify email addresses, sometimes it will and it will refuse to send messages.  If a message has to be relayed across servers, no verification is done, and you'll get a bounce if an email address is bad.

  • How to send HTML mail with images multipart/related message

    Hi,
    Could any body tell me how to send HTML mail with images in "multipart/related" message,if any body can give the code ,it would be helpful.
    Thanks

    Hi,
    Could any body tell me how to send HTML mail with
    ith images in "multipart/related" message,if any body
    can give the code ,it would be helpful.
    ThanksHi!
    Refer to
    http://developer.java.sun.com/developer/onlineTraining/JavaMail/index.html
    I've found it very helpful.
    Look at the last part for a code showing how to send HTML mail!
    Regards

  • How to send HTML Format Mail using Java Mail in oracle 9i Forms

    Dear All
    could you please tell me how to send HTML Format Mail using Java Mail in oracle 9i Forms and how to implement the java mail ?
    if it is possible, could you please send me the sample code? please very urgent
    Thanks
    P.Sivaraman

    Hello,
    <p>Here is a Form sample.</p>
    Francois

Maybe you are looking for

  • Data back up from Single User Mode

    Hello, I have a problem with my 700 MHz iBook, dual USB, with OS X 10.3.9. Unfortunately the OS doesn't start up because of "overlapped extent allocation" problem... I would like to re-install the complete OS but before doing it, I would like to back

  • Impact of Merging multiple company codes into ONE

    Hi, We are currently doing a study for a client,  they have the following scenario where the client has got multiple company codes in SAP (due to some tax benefits they had initially created the company codes) now the tax benefits cease to exist and

  • Sony BRAVIA network streaming

    Hello people, I am fairly new to the apple community and i am facing a problem. its been a whole week since i am trying to figure out how to stream video on my new bravia over the network. I ve even replaced my router last night. Equipment: Mac Pro -

  • Can my computer handle editing DVCPRO 1080?

    Hi. Im currently editing a feature length film. In the editing room, im currently set up with a Mac Pro running 2 2.66 Ghz Dual-Core Intel Xeon processors, with 2gb or ram, and a Aja Kona Card ran to an HD monitor. I'd like to take my work home with

  • Spotlight Search for 0KB Images?

    I'm having a big problem with my iPhoto Library. Is there a way for me to search for 0KB images in an iPhoto Library (say after I do a Show Package Contents)? If so, I'd love to get specific instructions on how to do this. Also, if there is a Spotlig