Sending  mail using utl_smtp

(Oracle 8.1.7)
I'm using the following procedure to send an HTML formatted e-mail. It sends email but I'm seeing in Outlook html code instead of formatted mail. (It sends text like :
a bit of text
--a1b2c3d4e3f2g1
content-type: text/html;
<html><head></head><body><B>HELLO </B></body></html>
a1b2c3d4e3f2g1
What can I solve this problem?
Thanks in advance...
its usage :
html_email('smo@....','smo2@...','This is a subject','a bit of text', '<html><head></head><body><B>HELLO </B></body></html>', 'some hostname',25);
CREATE OR REPLACE procedure html_email(
p_to in varchar2,
p_from in varchar2,
p_subject in varchar2,
p_text in varchar2 default null,
p_html in varchar2 default null,
p_smtp_hostname in varchar2,
p_smtp_portnum in varchar2)
is
l_boundary varchar2(255) default 'a1b2c3d4e3f2g1';
l_connection utl_smtp.connection;
l_body_html clob := empty_clob; --This LOB will be the email message
l_offset number;
l_ammount number;
l_temp varchar2(32767) default null;
begin
l_connection := utl_smtp.open_connection( p_smtp_hostname, p_smtp_portnum );
utl_smtp.helo( l_connection, p_smtp_hostname );
utl_smtp.mail( l_connection, p_from );
utl_smtp.rcpt( l_connection, p_to );
l_temp := l_temp || 'MIME-Version: 1.0' || chr(13) || chr(10);
l_temp := l_temp || 'To: ' || p_to || chr(13) || chr(10);
l_temp := l_temp || 'From: ' || p_from || chr(13) || chr(10);
l_temp := l_temp || 'Subject: ' || p_subject || chr(13) || chr(10);
l_temp := l_temp || 'Reply-To: ' || p_from || chr(13) || chr(10);
l_temp := l_temp || 'Content-Type: multipart/alternative; boundary=' ||
chr(34) || l_boundary || chr(34) || chr(13) ||
chr(10);
-- Write the headers
dbms_lob.createtemporary( l_body_html, false, 10 );
dbms_lob.write(l_body_html,length(l_temp),1,l_temp);
-- Write the text boundary
l_offset := dbms_lob.getlength(l_body_html) + 1;
l_temp := '--' || l_boundary || chr(13)||chr(10);
l_temp := l_temp || 'content-type: text/plain; charset=us-ascii' ||
chr(13) || chr(10) || chr(13) || chr(10);
dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
-- Write the plain text portion of the email
l_offset := dbms_lob.getlength(l_body_html) + 1;
dbms_lob.write(l_body_html,length(p_text),l_offset,p_text);
-- Write the HTML boundary
l_temp := chr(13)||chr(10)||chr(13)||chr(10)||'--' || l_boundary ||
chr(13) || chr(10);
l_temp := l_temp || 'content-type: text/html;' ||
chr(13) || chr(10) || chr(13) || chr(10);
l_offset := dbms_lob.getlength(l_body_html) + 1;
dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
-- Write the HTML portion of the message
l_offset := dbms_lob.getlength(l_body_html) + 1;
dbms_lob.write(l_body_html,length(p_html),l_offset,p_html);
-- Write the final html boundary
l_temp := chr(13) || chr(10) || '--' || l_boundary || '--' || chr(13);
l_offset := dbms_lob.getlength(l_body_html) + 1;
dbms_lob.write(l_body_html,length(l_temp),l_offset,l_temp);
-- Send the email in 1900 byte chunks to UTL_SMTP
l_offset := 1;
l_ammount := 1900;
utl_smtp.open_data(l_connection);
while l_offset < dbms_lob.getlength(l_body_html) loop
utl_smtp.write_data(l_connection,
dbms_lob.substr(l_body_html,l_ammount,l_offset));
l_offset := l_offset + l_ammount ;
l_ammount := least(1900,dbms_lob.getlength(l_body_html) - l_ammount);
end loop;
utl_smtp.close_data(l_connection);
utl_smtp.quit( l_connection );
dbms_lob.freetemporary(l_body_html);
end;

This forum is for Forms questions. Try asking this on another forum, such as the database forum or the PL/SQL forum.
Regards,
Robin Zimmermann
Forms Product Management

Similar Messages

  • Send mail using utl_smtp

    Hi Experts,
    I am using utl_smtp package to send a mail from oracle procedure. My procedure is
    CREATE OR REPLACE PROCEDURE TEST_UTLFILE_EMAIL (pSender VARCHAR2, pRecipient VARCHAR2, pSubject VARCHAR2, pMessage VARCHAR2) IS
    mailhost CONSTANT VARCHAR2(30) := 'host';
    crlf CONSTANT VARCHAR2(2):= CHR(13) || CHR(10);
    mesg VARCHAR2(1000);
    mail_conn utl_smtp.connection;
    BEGIN
    mail_conn := utl_smtp.open_connection(mailhost, 25);
    mesg := 'Date: ' ||
    TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss') || crlf ||
    'From: <'|| pSender ||'>' || crlf ||
    'Subject: '|| pSubject || crlf ||
    'To: '||pRecipient || crlf || '' || crlf || pMessage;
    utl_smtp.helo(mail_conn, mailhost);
    utl_smtp.mail(mail_conn, pSender);
    utl_smtp.rcpt(mail_conn, pRecipient);
    utl_smtp.data(mail_conn, mesg);
    utl_smtp.quit(mail_conn);
    EXCEPTION
    WHEN INVALID_OPERATION THEN
    NULL;
    WHEN TRANSIENT_ERROR THEN
    NULL;
    WHEN PERMANENT_ERROR THEN
    NULL;
    WHEN OTHERS THEN
    NULL;
    END TEST_UTLFILE_EMAIL;
    when i compiled this procedure, this is giving following error message.
    LINE/COL ERROR
    0/0 PL/SQL: Compilation unit analysis terminated
    19/8 PLS-00201: identifier 'INVALID_OPERATION' must be declared
    Please help me out in solving this.
    Regards,
    Chandu

    Define the exception's like
    CREATE OR REPLACE PROCEDURE TEST_UTLFILE_EMAIL(pSender VARCHAR2,
    pRecipient VARCHAR2,
    pSubject VARCHAR2,
    pMessage VARCHAR2) IS
    mailhost CONSTANT VARCHAR2(30) := 'host';
    crlf CONSTANT VARCHAR2(2) := CHR(13) || CHR(10);
    mesg VARCHAR2(1000);
    mail_conn utl_smtp.connection;
    invalid_operation EXCEPTION; -- Operation is invalid
    transient_error EXCEPTION; -- Transient server error in 400 range
    permanent_error EXCEPTION; -- Permanent server error in 500 range
    BEGIN
    mail_conn := utl_smtp.open_connection(mailhost, 25);
    mesg := 'Date: ' || TO_CHAR(SYSDATE, 'dd Mon yy hh24:mi:ss') || crlf ||
    'From: <' || pSender || '>' || crlf || 'Subject: ' ||
    pSubject || crlf || 'To: ' || pRecipient || crlf || '' || crlf ||
    pMessage;
    utl_smtp.helo(mail_conn, mailhost);
    utl_smtp.mail(mail_conn, pSender);
    utl_smtp.rcpt(mail_conn, pRecipient);
    utl_smtp.data(mail_conn, mesg);
    utl_smtp.quit(mail_conn);
    EXCEPTION
    WHEN INVALID_OPERATION THEN
    NULL;
    WHEN TRANSIENT_ERROR THEN
    NULL;
    WHEN PERMANENT_ERROR THEN
    NULL;
    WHEN OTHERS THEN
    NULL;
    END TEST_UTLFILE_EMAIL;

  • Sending e-mail using utl_smtp on oracle 9i

    Hello
    I have problem with sending e-mails using utl_smtp package.
    My code looks like this:
    lv_mail_conn := utl_smtp.open_connection(lv_mailhost_txt);
    utl_smtp.ehlo(lv_mail_conn, lv_mailhost_txt);
    res :=     utl_smtp.command(lv_mail_conn, 'AUTH LOGIN');
    res := utl_smtp.command(lv_mail_conn, <login in base64>);
    res := utl_smtp.command(lv_mail_conn, <password in base64>);
    And I get en error after sending a password to SMTP server.
    Error code: 535, text: 5.7.3 Authentication unsuccessful.
    This happens on oracle 9i.
    I have another server for testing which has oracle 10g installed. This code works fine on oracle 10g but doesn't work on oracle 9i.
    Do you have any ideas what's wrong? I assume that SMTP server (microsoft exchange) work correctlys because I can send e-mail from test server.

    Ok problem solved :)
    Problem was between oracle and MS exchange server. Live server oracle 9i is on linux, and testing server works on windows.
    So the problem was with configuration. Our admins corrected it and now works :). I don't know details.

  • Tracking Undelivered E-Mail using UTL_SMTP

    I am sending e-mail using UTL_SMTP. If there is any error in the e-mail delivery for e.g. say if the E-Mail bounced etc. then can i capture those events in my code?
    E-Mail can bounce back for any reason. for e.g. e-mail address is not valid. What all error we can capture using UTL_SMTP?
    Edited by: LostWorld on Jan 26, 2011 11:34 PM

    LostWorld wrote:
    I am sending e-mail using UTL_SMTP. If there is any error in the e-mail delivery for e.g. say if the E-Mail bounced etc. then can i capture those events in my code?Yes. But not via SMTP.
    The SMTP server receives the mail. It tells the client (your code, mail reader, whatever) that is has accepted the connection. That is the extent of the conversation. The SMTP protocol does not report on delivery steps, delivery status and so on.
    From a SMTP protocol perspective, the mail payload was delivered to that server. And that's it.
    The mail delivery runs into a problem. It could be on the SMTP server that accepted your mail. It could be a SMTP server on the other side of the world that is passing your e-mail along, 24 hours later.
    There are 2 types of problems. A soft bounce. This means that the server attempted delivery, and it failed - but the delivery attempt can be retried. For example, there could be a network problem (and this could shortly be rectified). In such a case, that SMTP server will look at the sender's address and send a soft bounce notification to the sender. It will describe the basic problem and how it will be handled - e.g. mail server may perform 3 more attempts at delivery in the next 12h and then hard bounce your e-mail.
    A hard bounce is a fatal error. For example, the SMTP server attempts to deliver your e-mail to its final destination (the mail server of the recipient's domain). That server says that the recipient (mail user) does not exist at that domain.
    In that case, the SMTP server will send the sender of that e-mail a hard bounce notification - informing the sender of what the fatal error is.
    So in order to get the bounce message, you need to supply a valid sender e-mail address when delivering that e-mail to the SMTP server. You then need to monitor that e-mail account (using the POP3 or IMAP protocols) for bounce e-mail notifications.
    However, even that will not indicate whether that original e-mail your code send was delivered successfully. And this is the bottom line - there are no guarantees. The SMTP and POP3/IMAP protocols cannot and do not guarantee you being able to determine whether or not an e-mail reached its intended destination.
    This is often why e-mails are send with a URL and a request that the recipient please click the URL when receiving the e-mail. That is the only method to determine whether the recipient received the e-mail, provided the recipient is willing to click that URL in that e-mail message.

  • How to setup and send mails using utl_mail on Oracle E-Biz R12

    Dear All
    There is a new requirement from client to setup and send mails using utl_mail utility on Oracle EBS R12.1.1
    What is utl_mail utility ? what is the difference between Workflow Notification Mailer and this utility/tool?
    What are etiquette's to pursue mail functionality in apps / db?
    - Chetan

    What is utl_mail utility
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_mail.htm
    How to Use the UTL_MAIL Package [ID 269375.1]
    FAQ and Known Issues While Using UTL_SMTP and UTL_MAIL [ID 730746.1]
    Master Note For PL/SQL UTL_SMTP and UTL_MAIL Packages [ID 1137673.1]
    Workflow Notification Mailer:
    you can send email using workflow notification email procedures,These ar built into the system and only need some minor configuration. check Workflow Administrator's Guide, Chapter 2, Section: Setting Up Notification Mailers for more detail.

  • Problems to SEND MAIL using WWV_FLOW_MAIL.SEND - APEX_MAIL

    I tried send mail using the code below
    DECLARE
    l_body      CLOB:= EMPTY_CLOB;
    l_body_html CLOB:= EMPTY_CLOB;
    BEGIN
    wwv_flow_api.set_security_group_id;
    l_body :='<html>
    +<head>+
    +<style type="text/css">+
    +body{font-family: Arial, Helvetica, sans-serif;+
                                   +font-size:10pt;+
                                   +margin:30px;+
                                   +background-color:#ffffff;}+
    +span.sig{font-style:italic;+
    font-weight:bold;
    color:#811919;}
    +</style>+
    +</head>+
    +<body>+
    +</html>';+
    l_body_html := '<html>
    +<head>+
    +<style type="text/css">+
    +body{font-family: Arial, Helvetica, sans-serif;+
                                   +font-size:10pt;+
                                   +margin:30px;+
                                   +background-color:#ffffff;}+
    +span.sig{font-style:italic;+
    font-weight:bold;
    color:#811919;}
    +</style>+
    +</head>+
    +<body>+
    +</html>';+
    wwv_flow_mail.send('[email protected]','[email protected]',nvl(l_body,'Texto com erro'),nvl(l_body_html,'erro2'),'K','[email protected]',
    +'[email protected]','[email protected]');+
    wwv_flow_mail.push_queue;
    END;
    +/+
    This code return the message:
    Mail To From Subject CC BCC Created On Created By Error Created
    CHECK$01 [email protected] [email protected] K [email protected] [email protected] 08/23/2010 03:05:00 PM SYS
    ORA-06502: PL/SQL: erro: erro de conversão de caractere em número numérico ou de valor
    Follow my mail settings
    SMTP Host Address : POP.SLE.TERRA.COM.BR
    SMTP Host Port 110
    Administration Email Address [email protected]
    Notification Email Address [email protected]
    what´s wrong ?

    I would try sending just basic text first, then move on to getting your other pieces dynamics. The very last step to me would be the email body.
    Here is an example of a basic text email I use:
    declare
      e_id        NUMBER;
      c_id        NUMBER;
      emp_nm      VARCHAR2(100);
      clrk_id     NUMBER;
      e_clrk      VARCHAR2(47);
      e_org       NUMBER;
      e_sender    VARCHAR2(50);
      e_recip_lst VARCHAR2(255); 
      e_cc        VARCHAR2(100);
      e_bcc       VARCHAR2(100);
      e_subj      VARCHAR2(50);
      e_msg_ln1   VARCHAR2(100);
      e_msg_ln2   VARCHAR2(100);
      e_msg_ln3   VARCHAR2(100);
      e_msg_ln4   VARCHAR2(100);
      e_msg_ln5   VARCHAR2(100);
      e_msg       VARCHAR2(1000);
      CRLF        CHAR(2) := CHR(13) || CHR(11);
      tmp_flag    NUMBER;
    begin
       if :P2_INJURY_FLAG = 1 then
       -- find out if it has changed first so we don't keep sending emails
        select injury_flag, VEH_LOC
          into tmp_flag, e_org
          from APPS.tc
         where tc_id = :P2_TC_ID;
       if :P2_injury_flag <> tmp_flag then
        begin
           select FN_GET_USER(nvl(v('APP_USER'),user))
             into clrk_id 
             from dual;
          select ADMIN_USERNAME
             into e_clrk
            from APPS.APEX_ACCESS_CONTROL
           where ID = clrk_id;
        exception
           when others then null; -- in case we cannot find the user
        end;
        e_id          :=  :P2_EMP_ID;
        c_id          :=  :P2_TC_ID;
        select EMP_FNAME ||' '|| EMP_MNAME ||' '|| EMP_LNAME into emp_nm
          from APPS.EMPLOYEES
         where EMP_ID = e_id;  --
        select RECIPIENTS, CC, BCC
          into e_recip_lst, e_cc, e_bcc
          from APPS.SAFETY_NOTIFICATIONS
         where ORG_ID = e_org;  --
          e_sender    :=  '[email protected]';
          e_subj      :=  'Loss Reported';
          e_msg_ln1   :=  'Employee: ' || emp_nm || ' (' || e_id || ')'  
                          || CRLF;
          e_msg_ln2   :=  'Was reported as sustaining a loss' || CRLF;
          e_msg_ln3   :=  'by ' || e_clrk ||CRLF;
          e_msg_ln4   :=  CRLF;
          e_msg_ln5   :=  'Sent ' || to_char(sysdate,'MONTH DD,YYYY HH:MI AM');
          e_msg       :=  e_msg_ln1 || e_msg_ln2 || e_msg_ln3 || e_msg_ln4 || e_msg_ln5 || CRLF || e_recip_lst;
         utl_mail.send(
           sender => e_sender,
           recipients => e_recip_lst,
           cc => e_cc,
           bcc => e_bcc,
           subject => e_subj,
           message => e_msg);
      end if;
    end if;
    end;

  • Cannot Send Mail using AIM account.

    I can receive mail fine but when I try to send mail I get the following message:
    Cannot send mail using the server smtp.aim.com:EmilyLozano.
    Use the pop-up menu below to try a different outgoing mail server. All messages will use this server until you quit Mail or change your network settings.
    Message from: Emily Lozano <[email protected]>
    I left for a trip a few days ago, came back and now for no apparent reason cannot send mail as I always have. I have reconfigured the port to 587 and that did not help. Any suggestions? (I can send and receive fine via the web, but I really hate it.)

    I'm glad you got it figured out. So many times people on this forum sit around waiting for help when they could have retraced their steps, like you did, to figure out the source of the problem.

  • How can send mails using hotmail/rediffmail domain name?

    I have used the below code to send a mail using javamail API?Even when I am sending my application does not have notified any of error/exceptions,But the message is not reached to I have given receipient's address in the to field.
    import javax.mail.*;
    import javax.mail.internet.*;
    import javax.activation.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class Sendmail1 extends HttpServlet {
    private String smtpHost;
    // Initialize the servlet with the hostname of the SMTP server
    // we'll be using the send the messages
    public void init(ServletConfig config)
    throws ServletException {
    super.init(config);
    smtpHost = config.getInitParameter("smtpHost");
    //smtpHost = "sbm5501";
    smtpHost = "www.rediffmail.com";
    public void doGet(HttpServletRequest request,HttpServletResponse response)
    throws ServletException, java.io.IOException {
    String from = request.getParameter("from");
    String to "[email protected]";
    String cc = "[email protected]";
    String bcc ="[email protected]";
    String smtp ="www.rediffmail.com";
    String subject = "hai";
    String text = "Hai how r u";
    PrintWriter writer = response.getWriter();
    if (subject == null)
    subject = "Null";
    if (text == null)
    text = "No message";
    String status;
    try {
    // Create the JavaMail session
    java.util.Properties properties = System.getProperties();
    if (smtp == null)
    smtp = "www.rediffmail.com";
    properties.put("mail.smtp.host", smtp);
    Session session = Session.getInstance(properties, null);
    //to connect
    //Transport transport =session.getTransport("smtp");
    //transport.connect(smtpHost,user,password);
    // Construct the message
    MimeMessage message = new MimeMessage(session);
    // Set the from address
    Address fromAddress = new InternetAddress(from);
    message.setFrom(fromAddress);
    // Parse and set the recipient addresses
    Address[] toAddresses = InternetAddress.parse(to);
    message.setRecipients(Message.RecipientType.TO,toAddresses);
    Address[] ccAddresses = InternetAddress.parse(cc);
    message.setRecipients(Message.RecipientType.CC,ccAddresses);
    Address[] bccAddresses = InternetAddress.parse(to);
    message.setRecipients(Message.RecipientType.BCC,bccAddresses);
    // Set the subject and text
    message.setSubject(subject);
    message.setText(text);
    Transport.send(message);
    //status = "<h1>Congratulations,</h1><h2>Your message was sent.</h2>";
    } catch (AddressException e)
    status = "There was an error parsing the addresses. " + e;
    } catch (SendFailedException e)
    status = "<h1>Sorry,</h1><h2>There was an error sending the message.</h2>" + e;
    } catch (MessagingException e)
    status = "There was an unexpected error. " + e;
    // Output a status message
    response.setContentType("text/html");
    writer.println("<title>sendForm</title><body bgcolor= ><b><h3><font color=green><CENTER>CALIBERINFO.COM</CENTER></h3>Your message was sent to recepient(s).<br><font color=red>"+"\n"+to);
    writer.println("<br><br><a href=e:/mail/javamail/mail.html>back to compose</a>");
    writer.close();
    Please any one help me out from this probs.
    Awaiting for yours reply,
    or give me a reply to: [email protected]
    Regards,
    @maheshkumar.k

    Hi,
    how can send mails using hotmail/rediffmail domain name?In your java application,you specified www.rediffmail.com as your
    smtp server.But that is the address of that website.Try will a smtp
    server instead.For a list of free smtp servers,please visit http://www.thebestfree.net/free/freesmtp.htm
    Hope this helps.
    Good Luck.
    Gayam.Srinivasa Reddy
    Developer Technical Support
    Sun Microsystems
    http://www.sun.com/developers/support/

  • Error while sending mail using script task in ssis 2008

    Hi,
        i am trying to send mail using ssis 2008 script task.for my requirement i am not able to use send mail task.
    code i have used is
    declared read only variables system::packagename
     Dim PACKAGE As String
            PACKAGE = Dts.Variables("System::PackageName").Value.ToString()
            Dim myHtmlMessage As MailMessage
            Dim mySmtpClient As SmtpClient
            myHtmlMessage = New MailMessage("[email protected]", "[email protected]", "PACKAGE STATUS", PACKAGE + "WAS FAILED")
         mySmtpClient = New SmtpClient("smtp.gmail.com")
            mySmtpClient.Credentials = New NetworkCredential("[email protected]", "mypassword")
            mySmtpClient.EnableSsl = True
            mySmtpClient.Port = 587
            mySmtpClient.Send(myHtmlMessage)
    error i am getting is
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
    Authentication Required. Learn more at
       at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
    can any one tell me where i am going wrong

    also getting error as follows
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
    Authentication Required. Learn more at
       at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

  • Issue  while sending mails using classes

    Hi Experts ,
    i have one issue when i try to send mails using classes cl_document_bcs,cl_cam_address_bcs,cl_bcs etc
    ISSUE :
    i put some data in selection screen and i get some output ( say i got 5 records), i select 3 records and press some button to trigger mail and mail is send, and now again the OUTPUT screen is  shown with  sended records but we can not send these records again ............ now i selcect remaining two records  and press button to trigger mail and THIS TIME MAIL IS NOT SEND.
    amd my code is :
    CREATE OBJECT l_document.
      CREATE OBJECT l_recipient.
      TRY.
          cl_bcs_convert=>string_to_solix(
          EXPORTING
          iv_string = fp_wa_output
          iv_codepage = fp_v_code_page
          iv_add_bom = 'X'
          IMPORTING
          et_solix = l_wa_output_binary
          ev_size = l_v_size ).
          l_send_request = cl_bcs=>create_persistent( ).
    *-->Creating Document
          l_document = cl_document_bcs=>create_document(
          i_type = 'RAW'
          i_text = fp_it_content[]
          i_subject = fp_text_48 ) .
    *-->Adding Attachment*
          CALL METHOD l_document->add_attachment
            EXPORTING
              i_attachment_type    = fp_text_049
              i_attachment_size    = l_v_size
              i_attachment_subject = fp_v_file
              i_att_content_hex    = l_wa_output_binary.
    *-->Add document to send request*
          CALL METHOD l_send_request->set_document( l_document ).
    *    do send delivery info for successful mails
          CALL METHOD l_send_request->set_status_attributes
            EXPORTING
              i_requested_status = 'E'
              i_status_mail      = 'A'.
    *-->Get Sender Object
          l_uname = sy-uname.
          l_sender = cl_sapuser_bcs=>create( l_uname ).
          CALL METHOD l_send_request->set_sender
            EXPORTING
              i_sender = l_sender.
          LOOP AT fp_s_mail INTO l_wa_mail.
            l_v_objid = l_wa_mail-low.
            l_v_mail = l_v_smtpadr.
            TRANSLATE l_v_mail TO LOWER CASE.
            l_recipient = cl_cam_address_bcs=>create_internet_address( l_v_mail ).
            CALL METHOD l_send_request->add_recipient
              EXPORTING
                i_recipient  = l_recipient
                i_express    = 'X' .
    *            i_copy       = ' '
    *            i_blind_copy = ' '
    *            i_no_forward = ' '.
          ENDLOOP.
    **-->Trigger E-Mail immediately*
    *      IF fp_send_all EQ 'X'.
    *        l_send_request->set_send_immediately( 'X' ).
    *      ENDIF.
          CALL METHOD l_send_request->send(
          EXPORTING
          i_with_error_screen = 'X'
            RECEIVING result = l_v_sent_to_all ).
          BREAK TARK.
          IF l_v_sent_to_all = 'X'.
            MESSAGE i000 .
          ENDIF.
        COMMIT WORK.
        CATCH cx_document_bcs INTO l_bcs_exception.
        CATCH cx_send_req_bcs INTO l_send_exception.
        CATCH cx_address_bcs INTO l_addr_exception.
        CATCH cx_bcs INTO l_exp.
      ENDTRY.
    thanks in advance
    rahul

    Every time when i choose other network or dongle to send those mails it gets sent.
    As per the description, seems it's an issue related to this specific network. Probably, they've adjusted their security policy, like blocked some port numbers, etc.
    You might need to contact the support of your ISP to confirm what SMTP settings you need. Check port number, and security settings.
    By the way, this is the forum to discuss questions and feedback for Windows-based Microsoft Office client. Since your query is directly related to
    Office for mac, I would suggest you to post in the forum of
    Office for Mac, where you can get more experienced responses:
    http://answers.microsoft.com/en-us/mac/forum/macoffice2011?tab=Threads
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.
    Regards,
    Ethan Hua
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • Send mail using Internal Mail server doesn't work

    I can't send mail using my companies mail server, which requires authentication and port 587 to send.  We have a valid, non self-signed SSL certificate so that is not the issue.  I can send mail using Bell's mail server but that violates our regulatory compliance obligations. 
    The server using POP3 and one must login to get mail as well as send.  Unfortunately there is no otehr error message than the: error sending "mail subject".  No further details are provided and when we check the mail servers logs its clear the Pre isn't even attempting to connect to the mail server.  So the request to send mail isn't even being sent out.  That could be an issue with the Pre or with Bell but Bell support will only troubleshoot to the point of fidning out if you can send using their mail server.  We can so their support stops at that point.
    I still have v1.3.1 of the WebOS as v1.3.5 doesn't seem to be out for the Bell Pre's yet.  But from what I've read v1.3.5 is even worse at handling mail not better.  However, there may be a solution out there to this beyond sending the Pre's back (I doubt we can) as Balckberry's and iPhone's don't have this issue.
    Any advice is greatly appreciated.
    Post relates to: Pre p100eww (Bell)

    Further update on this problem.  It does send if I use TLS instead of SSL so that must mean that the Palm Pre doesn't use SSLv3 or higher.  As TLS is a viable security setting option to maintain compliance I can use that.  But still Plam should seriously consider upgrading tis SSL versioning.

  • How to send mail using jsp program

    am very new to jsp and doing my final year project. i need to send mails using my jsp program.can anyone say wht to do that is wht to include to send mails using jsp program. n also a sample code to send mail using jsp program.
    Thanx in advance

    Use below script.
    <%@ page import="java.util.*, javax.mail.*, javax.mail.internet.*" %>
    <%
    Properties props = new Properties();
    props.put("mail.smtp.host", "mailserver.com");
    Session s = Session.getInstance(props,null);
    InternetAddress from = new InternetAddress("[email protected]");
    InternetAddress to = new InternetAddress([email protected]");
    MimeMessage message = new MimeMessage(s);
    message.setFrom(from);
    message.addRecipient(Message.RecipientType.TO, to);
    message.setSubject("Your subject");
    message.setText("Your text");
    Transport.send(message);
    %>{code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Delivery Receipt After Sending Mail Using JavaMail ?

    Hi Friends,
    I have written an application using JavaMail which would be used to send mail
    using my organisation's SMTP Server.I would like to include the following functionality in it.Just as
    Microsoft's Outlook has an option to get Delivery Receipt of the mail and Read Receipt of the mail sent
    (Provided the email Client supports it) i would like to have a similar option in my application to.I would like to of how i can do it using JavaMail.I heard that basically we need to set some SMTP properties which the Mail Transfer Agent would recognize and send us the Delivery and Read Receipts.But,i am not sure of what those properties.Can anyone help me regarding this ?

    You might look into creating a custom header that provides a return reciept to the email address you specify. I'm not 100% sure that all mail servers support this but you might want to look into it as a solution.
    -Dave

  • TS3276 Anyone experiencing problems sending mail using TalkTalk - can receive but not send  - was ok up until pm 24/08/12 - have recently loaded Mountain Lion patch could this be the problem?

    Anyone experiencing problems sending mail using Apple Mail viaTalkTalk - can receive but not send  - was ok up until pm 24/08/12 - have recently loaded Mountain Lion patch could this be the problem?

    jag157 wrote:
    "I managed to solve the problem. Under smtp settings (mail preferences/accounts/edit smtp) I set the outgoing port to 25 (as recommended by Talktalk), no authentication (set to none) and unchecked SSL. I found that until I set the port to 25 and authentication to none I was unable to uncheck SSL. One I had done this I was able to send from my main email and other email adddresses set up under my account."
    Superb advice R&W!  My email sending block using TalkTalk started 2 months ago using Snow Leopard, continued when I upgraded to 10.8.2, and has been persistent on my wife's new iPad (IOS 6.1).  Implementing your wise words has fixed all that, and now enables me to call her on FaceTime — previously only she could call me.  Thank you so much; this will save hours of further fruitless searching and phoning.
    Please remember that your email is now insecure, if you wish to have a secure connection SSL must be on and port 25 should be avoided.

  • Can  not send mail using wifi at a motel .I can receive mail fine

    can  not send mail using wifi at a motel .I can receive mail fine

    Hi there tamarafromdarien,
    You may find the troubleshooting steps for iCloud Mail in the article below helpful.
    iCloud: Troubleshooting iCloud Mail
    If you can't send mail in OS X Mail
    If you receive this alert or a similar alert when sending a message from your iCloud email address in OS X Mail:
    “This message could not be delivered and will remain in your Outbox until it can be delivered. The reason for the failure is: An error occurred while delivering this message via the smtp server: server name.”
    In OS X Mail, choose Preferences from the Mail menu.
    Click Accounts in the Preferences window.
    Select your iCloud account from the list of accounts.
    Click the Account Information tab.
    Choose your iCloud account from the Outgoing Mail Server (SMTP) pop-up menu. Example: “Derrick Parker (iCloud)”.
    Note: The Outgoing Mail Server (SMTP) menu also includes an Edit SMTP Server List command. If you choose this command, be aware that the iCloud SMTP server won't be among the servers that can be edited. This is normal.
    If you're attaching a large file
    Message attachments can't exceed the maximum size allowed by your email service provider or the recipient's email service provider. The maximum size varies by service provider. Try compressing the filebefore sending it, or send your message without the attachment to verify that there are no issues with sending.
    -Griff W.  

Maybe you are looking for