Send mail utl_smtp - The subject comes out blank

Hi,
The following procedure does work, however I can either send the Subject line OR the message body. If I send the subject first, the subject is sent. If I send the msg body first, then the msg body gets sent.
Why can't I send both ? Please help.
Thanks,
Bob
PROCEDURE send_mail2 (psender IN VARCHAR2,
precipient IN vARCHAR2, psubject in VARCHAR2, pmessage IN VARCHAR2)
IS
mailhost VARCHAR2(30) := 'smtp.ny.drf.com';
mail_conn utl_smtp.connection;
BEGIN
mail_conn := utl_smtp.open_connection(mailhost, 25);
utl_smtp.helo(mail_conn, mailhost);
utl_smtp.mail(mail_conn, psender);
utl_smtp.rcpt(mail_conn, precipient);
UTL_SMTP.DATA(mail_conn, 'Subject: ' || psubject || utl_tcp.crlf );
utl_smtp.data(mail_conn, utl_tcp.crlf || pmessage || utl_tcp.crlf );
utl_smtp.quit(mail_conn);
EXCEPTION
WHEN OTHERS THEN
null; -- Handle the error
END;

Your message is send directly after the headers. Insert an extra \r\n, and you should be fine.

Similar Messages

  • Canon Pixma 922 - when I copy a document the pages come out blank.

    When I copy a document the pages came out blank.
    Also, when I print an MS-Word document, the pages come out blank, however, if I print an HTML document from a website, the printer prints fine.

    Hi dstei33162,
    Since HTML documents are printing correctly, it is possible that the large black ink tank in the unit may be clogged.  You can print a nozzle check pattern from the printer to see if the inkjet nozzles are dispensing the ink correctly.  To do this, please follow the steps located here.  Once it is printed, please examine it and compare it to a correctly print pattern here.  If all of the colors are not appearing, including the black grid at the top above the colors, performing print head cleanings on the unit may resolve the issue.  To perform the cleanings, please follow the steps located here.  We recommend performing at least one cleaning and two deep cleanings.
    Should you still experience difficulty, the printer may require servicing; please call or email us using one of the methods on the Contact Us page for further assistance.
    Did this answer your question? Please click the Accept as Solution button so that others may find the answer as well.

  • I have a pdf file filled out but when i print, the doc comes out blank

    I have a pdf file filled out but when I print, the document comes out blank

    Is the base form printed?
    If so, in the Print Dialog, verify that in the Comments and Forms field > Document and Markups is selected

  • HT4356 My iPad and printer talk but the picture comes out blank...any suggestions?

    My photo paper comes out blank but my iPad and printer are connected because when I select print from iPad the printer starts working. Only problem is the paper comes out blank.

    Make sure your Canon is using the latest firmware.

  • Why does my printer work but the paper comes out blank. ink cartridges are full.

    My printer sounds like it is printing but the paper comes out blank.  The ink cartridges are full.

    What printer model - there are about a dozen HP Photosmart Premium models including the c309a, b, c, g, h and n and the c410a,b,c,d and e. 
    There are a few things to check - I would suggest running up to three cycles of print head cleaning from the front panel or toolbox.   Do copies also come out blank?  Try the steps in this page, starting at about Solution 6.  Does any ink at all print on the test page? 
    For some models there are firmware updates available that are only delivered through the web connection.  Make sure the printer has been connected and perform any updates that are available for the firmware.
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • I have an iPhone4. I am unable to open my Mail icon - the screen comes up blank even though the icon shows 182 unread emails waiting. I uninstalled my email accounts and re-installed them - no change in the problem. Other apps work.

    On my iPhone4, when I hit the Mail Icon I come up with a blank screen, though the Icon shows 182 unread emails waiting to be viewed. I uninstalled my mail accounts, and then re-installed them with no success. Other apps work fine

    On my iPhone4, when I hit the Mail Icon I come up with a blank screen, though the Icon shows 182 unread emails waiting to be viewed. I uninstalled my mail accounts, and then re-installed them with no success. Other apps work fine

  • TS3276 When I reply to an e-mail it comes out blank the other end?

    I do not have problems sending e-mails but when I reply to an e-mail it sends but comes out blank the other end?

    '''re: Forwarding'''
    You have the option to forward the received email 'inline' or as an 'attachment'.
    This can be set up here:
    'Tools' > 'Options' > 'Composition' > 'General' tab
    This is because you are not responding to a specific email - you are selecting to forward information from a different person to another person, which may be best sent as an attachment.
    '''re: Reply'''
    In this instance you have the option to either:
    * include the received email in a reply
    * Not include the received email in a reply
    * include selected part (quote) of received email in reply.
    A Reply implies a continued conversation and so the option to include the conversation is available.
    This is set up here:
    'Tools' > 'Account Settings' > 'Composition & Addressing' for the mail account.
    But regardless of whether you choose to 'automatically quote the original message when replying' or not, you can always highlight a section of text and then click on 'Reply' to include only the selected section of text.
    A Reply will also not include any attachments that were received attached to the original email because you do not need to send back the senders own attachments.
    Otherwise you create a new 'Write' message and attach the original email, so it is not technically a Reply - you do not use the 'Reply' button and these emails will not be threaded. It makes it more difficult to see continuity of conversation.

  • HT1277 I can recieve emails but I can't send them out.  The blue bar at the bottom left of the Mail page gets half way across and then the pop-up "Cannot send message using the server" comes up?  What do I do?

    I have my Yahoo Mail "poped" over to Apple Mail.  I can recieve emails but I can't send them out.  The blue bar at the bottom left of the Mail page gets half way across and then the pop-up "Cannot send message using the server" comes up?  What do I do?

    Your outgoing mail server is different than your incoming server. Usually the outgoing mail server will have smtp in it. I noticed yours said "cannot send message using the server mail.wavecable.com". That sounds like an incoming mail server. Try setting your outgoing mail server to smtp.wavecable.com
    I hope that helps.

  • When I send an e-mail with text it comes out gobble de gook the other end

    when I send an e-mail with text it comes out the other end gobble de gook and the recipient cannot under stand what I am saying it does not happen with anyone else only Mozilla Firefox
    == This happened ==
    Every time Firefox opened
    == past two years since I got vista

    Hi aandjmibert; 
    Hope you are doing well and sorry to hear that you are having this issue.
    Let’s make sure that we collect the most possible information may be relevant to your issue. Please bear in mind the more information that you provide to us the better picture we will have about the factor or factor that are contributing to your situation.
    Please provide to us as most of the following information as possible to you.
    ~ OS Operating system i.e. Apple, Win, Linux. Let’s us know if the operating system is updating automatically or not. If you are able please let us know the build.
    ~ Complete printer model i.e HP Photostat c310a.
    ~ Please include any other information that you feel may be relevant.
    I reintegrate the fact that the more information you include, the better the chances of all members of the community to gather a complete picture of your situation and this will increase the probabilities being able to help you in a promptly and more effective matter.
    Thanks
    You can say THANKS by clicking the KUDOS STAR. If my suggestion resolves your issue Mark as a "SOLUTION" this way others can benefit Thanks in Advance!

  • When I send a text message to my two children with non-smart phones, the message comes throug blank. When I send a message to them one at a time it will go through but not multiple addresses. Can this problem be fixed?

    When I send a text message on my iPhone 4s to my two children with non-smart phones, the message comes through blank. If I send it to each one individually, it will go through ok. Is this a problem with my phone or it is something I am doing wrong.

    Check your phone to make sure MMS is turned on. If it is, check with your cell provider and make sure your phone is provisioned correctly.

  • The first sheet coming out is always blank Also how can I have the pages come out 1-9 instead of

    first page come out blank    I want sheets to come out 1-9  not 9-1

    Please read this post then provide some details.  What printer model? What operating system? How is the printer connected - USB, wired LAN, Wireless LAN, bluetooth? Are there any error messages on the printer or computer screen?  Do you have a separator page selected?  The page order typically may be changed in the Advanced tab of printer preferences, look for a "Page order" selection with an option of "Front to Back" or "Back to Front"
    Bob Headrick,  HP Expert
    I am not an employee of HP, I am a volunteer posting here on my own time.
    If your problem is solved please click the "Accept as Solution" button ------------V
    If my answer was helpful please click the "Thumbs Up" to say "Thank You"--V

  • I have a hp office jet printerand when i print e mails the writing comes out small

    i have a hp office jet printer and when i print e mails the writing coms out small

    Hello tallcool1,
    Welcome to the HP Support Forums!
    I see that your Officejet printer and Email are not working together to produce a proper print, the font seems to be much smaller. Please answer the below question to allow me better ability to assist you.
    What model of printer is your Officejet?
    What is the Operating System installed on the computer, Windows or Mac?
    What is the Email you are trying to print from, MSN, Gmail, Yahoo, etc?
    Will the small font issue happen from other programs, Notepad for example?
    Cheers,
    JERENDS
    I work on behalf of HP
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping!

  • Problem in sending mail with the given code

    package booodrive;
    Some SMTP servers require a username and password authentication before you
    can use their Server for Sending mail. This is most common with couple
    of ISP's who provide SMTP Address to Send Mail.
    This Program gives any example on how to do SMTP Authentication
    (User and Password verification)
    This is a free source code and is provided as it is without any warranties and
    it can be used in any your code for free.
    Author : Sudhir Ancha
    import javax.mail.*;
    import javax.mail.internet.*;
    import java.util.*;
    import java.io.*;
      To use this program, change values for the following three constants,
        SMTP_HOST_NAME -- Has your SMTP Host Name
        SMTP_AUTH_USER -- Has your SMTP Authentication UserName
        SMTP_AUTH_PWD  -- Has your SMTP Authentication Password
      Next change values for fields
      emailMsgTxt  -- Message Text for the Email
      emailSubjectTxt  -- Subject for email
      emailFromAddress -- Email Address whose name will appears as "from" address
      Next change value for "emailList".
      This String array has List of all Email Addresses to Email Email needs to be sent to.
      Next to run the program, execute it as follows,
      SendMailUsingAuthentication authProg = new SendMailUsingAuthentication();
    public class SendMailUsingAuthentication
      private static final String SMTP_HOST_NAME = "sample.com";
      private static final String SMTP_AUTH_USER = "demo";
      private static final String SMTP_AUTH_PWD  = "demo";
      private static final String emailMsgTxt      = "Online Order Confirmation Message. Also include the Tracking Number.";
      private static final String emailSubjectTxt  = "Order Confirmation Subject";
      private static final String emailFromAddress = "[email protected]";
      // Add List of Email address to who email needs to be sent to
      private static final String[] emailList = {"[email protected]"};
      public static void main(String args[]) throws Exception
        SendMailUsingAuthentication smtpMailSender = new SendMailUsingAuthentication();
        smtpMailSender.postMail( emailList, emailSubjectTxt, emailMsgTxt, emailFromAddress);
        System.out.println("Sucessfully Sent mail to All Users");
      public void postMail( String recipients[ ], String subject,
                                String message , String from) throws MessagingException
        boolean debug = false;
         //Set the host smtp address
         Properties props = new Properties();
         props.put("mail.smtp.host", SMTP_HOST_NAME);
         props.put("mail.smtp.auth", "true");
        Authenticator auth = new SMTPAuthenticator();
        Session session = Session.getDefaultInstance(props, auth);
        session.setDebug(debug);
        // create a message
        Message msg = new MimeMessage(session);
        // set the from and to address
        InternetAddress addressFrom = new InternetAddress(from);
        msg.setFrom(addressFrom);
        InternetAddress[] addressTo = new InternetAddress[recipients.length];
        for (int i = 0; i < recipients.length; i++)
            addressTo[i] = new InternetAddress(recipients);
    msg.setRecipients(Message.RecipientType.TO, addressTo);
    // Setting the Subject and Content Type
    msg.setSubject(subject);
    msg.setContent(message, "text/plain");
    Transport.send(msg);
    * SimpleAuthenticator is used to do simple authentication
    * when the SMTP server requires it.
    private class SMTPAuthenticator extends javax.mail.Authenticator
    public PasswordAuthentication getPasswordAuthentication()
    String username = SMTP_AUTH_USER;
    String password = SMTP_AUTH_PWD;
    return new PasswordAuthentication(username, password);
    package booodrive;
    public class Test {
         public static void main(String args[]){
              SendMailUsingAuthentication authProg = new SendMailUsingAuthentication();
    I am not able to send mail using the above given codes. Can anyone please help?
    Rony
    Edited by: RonyFederer on Aug 10, 2008 9:04 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Your first step is to diagnose the problem.
    1. Does the code compile? If not, what error messages appear?
    2. Does the code run? If not, what error messages appear? What's in the stack trace?
    3. Does the code do what you expect it to do? If not, what are the differences?

  • How can i send mail to the yahoo mail or gmail or something else

    hello guys,
    i want to know how to send mails to the yahoo or gmail or something else.i heard that we have to change some smtp address and some port number. can any body suggest me to get that.please help me
    any replies will be appreciated greatly.

    Hi chnaresh,
    This is the code I use to send mail, it's not specific to gmail, but it works. The "props" object expects the usual mail properties, "mail.smtp.host", "mail.user" or "mail.smtp.user", as well as "mail.smtp.ssl" which you'd want to set to "true" if you're using gmail. It also expects "mail.smtp.passwd" or "mail.passwd" which my gut tells me is unsafe, but I'm not sure why.
    Good luck,
    radikal_3dward
    public static int sendMail(final Properties props, String subject, String body, String to, String cc, String bcc, String from, File[] attachments, boolean toStdOut)
    throws javax.mail.internet.AddressException, javax.mail.MessagingException, javax.mail.NoSuchProviderException
    Session sess;
    //props.setProperty("mail.debug", "true");
    if(props.getProperty("mail.smtp.ssl") != null && props.getProperty("mail.smtp.ssl").equalsIgnoreCase("true"))
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    String portStr = ((props.getProperty("mail.smtp.port") != null) ? (props.getProperty("mail.smtp.port")) : "465");
    props.put("mail.smtp.auth", "true");
    props.put("mail.smtp.socketFactory.port", portStr);
    props.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");
    props.put("mail.smtp.socketFactory.fallback", "false");
    sess = Session.getDefaultInstance(props,
    new javax.mail.Authenticator()
    protected PasswordAuthentication getPasswordAuthentication()
    String userName = ((props.getProperty("mail.smtp.user") != null) ? props.getProperty("mail.smtp.user") : props.getProperty("mail.user"));
    String passwd = ((props.getProperty("mail.smtp.passwd") != null) ? props.getProperty("mail.smtp.passwd") : props.getProperty("mail.passwd"));
    if(userName == null || passwd == null)
    return null;
    return new PasswordAuthentication(userName , passwd);
    else
    String portStr = ((props.getProperty("mail.smtp.port") != null) ? (props.getProperty("mail.smtp.port")) : "25");
    sess = Session.getInstance(props, null);
    //sess.setDebug(true);
    MimeMessage mess = new MimeMessage(sess);
    mess.setSubject(subject);
    StringTokenizer toST = new StringTokenizer(to, ",;");
    while(toST.hasMoreTokens())
    Address addr = new InternetAddress(toST.nextToken());
    mess.addRecipient(Message.RecipientType.TO, addr);
    if(from != null)
    StringTokenizer fromST = new StringTokenizer(from, ",;");
    InternetAddress[] fromAddrs = new InternetAddress[fromST.countTokens()];
    for(int i = 0; fromST.hasMoreTokens(); i++)
    fromAddrs[i] = new InternetAddress(fromST.nextToken());
    mess.addFrom(fromAddrs);
    if(cc != null)
    StringTokenizer ccST = new StringTokenizer(cc, ",;");
    while(ccST.hasMoreTokens())
    Address addr = new InternetAddress(ccST.nextToken());
    mess.addRecipient(Message.RecipientType.CC, addr);
    if(bcc != null)
    StringTokenizer bccST = new StringTokenizer(bcc, ",;");
    while(bccST.hasMoreTokens())
    Address addr = new InternetAddress(bccST.nextToken());
    mess.addRecipient(Message.RecipientType.BCC, addr);
    BodyPart messageBodyPart = new MimeBodyPart();
    Multipart multipart = new MimeMultipart();
    if(body != null)
    messageBodyPart.setText(body);
    multipart.addBodyPart(messageBodyPart);
    if(attachments != null)
    for(int i = 0; i < attachments.length; i++)
    messageBodyPart = new MimeBodyPart();
    DataSource source = new FileDataSource(attachments);
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(attachments[i].getName());
    multipart.addBodyPart(messageBodyPart);
    mess.setContent(multipart);
    Address[] allRecips = mess.getAllRecipients();
    if(toStdOut)
    System.out.println("done.");
    //System.out.println("Sending message (\"" + mess.getSubject().substring(0,10) + "...\") to :");
    System.out.println("Sending message (\"" + mess.getSubject() + "...\") to :");
    for(int i = 0; i < allRecips.length; i++)
    System.out.print(allRecips[i] + ";");
    System.out.println("...");
    Transport.send(mess);
    if(toStdOut)
    System.out.println("done.");
    return 0;

  • I can't send mail to the site that required Authenticator

    How can I send mail to the smtp site that required Authenticator,If th smtp site doesn't require Authenticator ,I can send mail.
    My program:
    Properties props=new Properties();
    props.put("smtp","smtp.163.com");
    props.put("auth","true");
    MailUser mu=new MailUser("username","password");
    javax.mail.Session session=javax.mail.Session.getDefaultInstance(props,mu);
    public class MailUser extends Authenticator
    String username;
    String password;
    public MailUser(String us,String ps)
    this.username=us;
    this.password=ps;
    }

    Properties props = System.getProperties();
    props.put("mail.smtp.host", "hiart.co.kr");
    props.put("mail.smtp.auth","true");//auth module....
    session = Session.getDefaultInstance(props,null);
              Date date = new Date();
    msg = new MimeMessage(session);
              System.out.println(from);
    msg.setFrom(new InternetAddress(from+"@hiart.co.kr"));

Maybe you are looking for

  • Excise Duty

    Hi All My clint using SAP from jan 2009. fiscal year Jan-Dec.one of my clint verdor sent a debit note for Material rate differneces.this debit note has a excise duty also.Actuval invoice is made in Legacy system in Novamber 2008. now vendor sent a de

  • Creating a block key default for documents created by MIRO?

    Hi All, Could anyone tell me how to create a block key default for documents created by MIRO?   Thanks Gandalf

  • Connection issues, what exactly is the fault

    I have reported yet another fault to BT India (and with respect to them I find the whole process frustrating). After wasting 30 mins running through their script which they cannot deviate from, despite having done all the steps prior to making the ca

  • TS2481 I can't rename a group I imported into my address book?

    I can't rename a group I imported into my address book...It just says "last import" and in the menu it is not available to choose....

  • Java Thread doubt

    i am having a code where i call notify(), but it notifies all the thread.. (i am not using notifyAll() ). please tell me what is the problem ... the code snippet is below class Waiter extends Thread      Object n;      public Waiter(Object not){