Email to hotmail or yahoo from Database trigger

Hi all.
I m working on Oracle Developer 6i with Oracle 9i.
OS is Windows XP. My Oracle database is on Samba Server.
I m using Exchange Server as my mail server.
I want to send emails to hotmail, yahoor or any other mail server from my company.
I have already create a database procedure to send mails within my company.
I m using following procedure.
PROCEDURE send_mail(p_to IN VARCHAR2,
p_subject IN VARCHAR2,
p_body IN VARCHAR2,
p_from IN VARCHAR2)
IS
con utl_smtp.connection;
l_log_err varchar2(4000);
PROCEDURE send_header(name IN VARCHAR2, header IN VARCHAR2) is
BEGIN
utl_smtp.write_data(con,name||': '||header||chr(13)||chr(10));
END;
BEGIN
con := utl_smtp.open_connection(hd_parameter.setting('MAILSVR'));
utl_smtp.helo(con,hd_parameter.setting('DOMAIN'));
utl_smtp.mail(con, p_from);
utl_smtp.rcpt(con, p_to);
utl_smtp.open_data(con);
send_header('From', 'Help Desk System');
send_header('To', p_to);
send_header('Subject', p_subject);
utl_smtp.write_data(con,chr(13)||chr(10)||p_body);
utl_smtp.close_data(con);
utl_smtp.quit(con);
EXCEPTION
WHEN utl_smtp.transient_error or utl_smtp.permanent_error THEN
BEGIN
utl_smtp.quit(con);
EXCEPTION
WHEN utl_smtp.transient_error or utl_smtp.permanent_error THEN
Null;
END;
/* Create the error log file if send mail fails
Added: June 03, 2004 by Hassan Raza*/
l_log_err := sqlerrm;
insert into mail_log_error
values(sysdate, 'Failed to send mail due to the following error:'||l_log_err);
END;
Best Regards
Hassan

Hi Justin
I got the following error
Failed to send mail due to the following error:ORA-29279: SMTP permanent error: 550 5.7.1 Unable to relay for [email protected]
Failed to send mail due to the following error:ORA-29279: SMTP permanent error: 550 5.7.1 Unable to relay for [email protected]
Can you help me what should i do in this case?
Best Regards
Hassan Raza

Similar Messages

  • How to send error message to forms from Database Trigger

    Hi, Please help me to send error message to forms from Database Trigger?
    RgDs,
    Madesh.R.M

    You are correct, the On-Error trigger is a Forms trigger. However, if your Form is going to display the error generated by the database stored procedure or trigger - you might not see the database error in your Form unless you check the DBMS_ERROR_CODE in the On-Error trigger and manually display the Error Code and associated Text. I've see this happen with a co-worker. The Form she was working on was based on a table with an Before-Insert trigger. Because she was not explicitely handling the error from the Before-Insert trigger in the Forms On-Error trigger, her Form appeared to halt for no reason at all. Once she added code to the On-Error trigger in the Form to handle the DBMS_ERROR_CODE, she discovered the trigger was producing an error and was able to show the error to the user in the On-Error trigger.
    I understand the desire to keep as much as possbile in the database, but with that comes some extra coding in your Forms to handle this. This extra coding could easily be placed in a Forms Library, attached to a Form and called in the On-Error trigger. Your code could look like this:
    DECLARE
       /*This example assumes you have an Alert defined
          in your Form called: 'ERROR' */  
       al_id    ALERT;
       al_text  VARCHAR2(200);  /* Max text of a Forms Alert message*/
       al_btn   NUMBER;
    BEGIN
    IF DBMS_ERROR_CODE != 0 THEN
       /* Error code is ORA-00000 Normal Successful completion
           So only handle non-zero errors  */
       al_text := DBMS_ERROR_CODE||':'||DBMS_ERROR_TEXT;
       al_id := Find_Alert('ERROR');
       set_alert_property(al_id, alert_message_text, al_text);
       al_btn := show_alert(al_id);
    END IF;
    END;Your original question was "How to send error message to forms from Database Trigger?" The answer is you don't because Forms already gets the database error code and database message through the Forms DBMS_ERROR_CODE and DBMS_ERROR_TEXT functions. Look these up in the Forms help and it should clear things up for you.
    Craig...
    Edited by: CraigB on Jun 14, 2010 4:49 PM
    Edited by: CraigB on Jun 14, 2010 4:49 PM
    Edited by: CraigB on Jun 14, 2010 4:50 PM
    Edited by: CraigB on Jun 14, 2010 4:51 PM
    Edited by: CraigB on Jun 14, 2010 4:51 PM

  • Invoke Report From Database trigger

    Hi,
    Is it possible to invoke a report from a database trigger?
    The requirement is to start a report after a record was inserted in a table.
    Thank you,
    Alex.

    Hi
    I was looking for exactly the same thing. I need to invoke a report in response to an update in the database. To make things even more complicated, I want to send the report to an email add. Is that something anyone has already taken a look at? Any help appreciated.
    _*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Report in PDF format and email it to some clients, using  Database Trigger

    Hi
    Is it possible to run a report in PDF format ad email it to some clients after a specific event through Database Trigger. For example whenever a client makes an entry into order entry table (through entry form), a trigger should execute on Orders table, this trigger should execute or generate a PDF formatted report and finally mail it to Sales team?
    I have
    ORAS 10g(10.1.2.0.2)
    utl_mail configured.

    In Reportsconfig.properties file the http port is 7778,
    now the output is like this...
    SQL> /
    * WELCOME TO EVENT-BASED-REPORTING API *
    * API-Version : 9i *
    * (C) Oracle Corporation, 2000 - 2002 *
    * Debugging turned ON **************************
    *** Length of Paramlist : 1
    OK : Parameter added : GATEWAY=http://myserver.com:7778/reports/rwservlet
    *** Length of Paramlist : 2
    OK : Parameter added : SERVER=rep_myserver_oracleas2
    *** Length of Paramlist : 3
    OK : Parameter added : REPORT=D:\Reports\emp.rdf
    *** Length of Paramlist : 4
    OK : Parameter added : USERID=abc/xyz@mydb
    *** Length of Paramlist : 5
    OK : Parameter added : DESTYPE=mail
    *** Length of Paramlist : 6
    OK : Parameter added : DESFORMAT=PDF
    *** Length of Paramlist : 7
    OK : Parameter added : [email protected]
    Starting run_report: building url
    *** Building URL (RUN_REPORT)
    OK : URL built :
    http://myserver.com:7778/reports/rwservlet?SERVER=rep_myserver_oracleas2&REPO
    RT=D%3A%CReports%5Cemp.rdf&USERID=abc%2Fxyz%40mydb&DESTYPE=mail&D
    ESFORMAT=PDF&DESNAME=khan.emran84%40gmail.com&statusformat=xml
    *** Submitting HTTP Request
    *** using URL
    :http://myserver.com:7778/reports/rwservlet?SERVER=rep_myserver_oracleas2&REP
    ORT=D%3A%5CReports%5Cemp.rdf&USERID=abc%2Fxyz%40mydb&DESTYPE=mail&
    DESFORMAT=PDF&DESNAME=khan.emran84%40gmail.com&statusformat=xml
    OK : Request submitted - Return stream : <?xml version = '1.0' encoding =
    'ISO-8859-1' standalone = 'yes'?>
    <serverQueues>
    <error code="50159"
    component="REP" message="Executed successfully but there were some errors when
    distribute the output"/>
    <
    OK : Request submitted - Length of stream : 229
    *** XML-Parsed - Following Structure discovered :
    *** Checking elements!
    serverQueues ()
    *** Checking attributes!
    error
    *** Checking attributes!
    __code = 50159
    __component = REP
    __message = Executed successfully but there were some errors when distribute the
    output
    *** Finished Parsing XML
    Getting value for element: job
    Getting value for element: error
    *** Requesting value for Attribute error.component [REP]
    Getting value for element: error
    *** Requesting value for Attribute error.code [50159]
    Getting value for element: error
    *** Requesting value for Attribute error.message [Executed successfully but    
    there were some errors when distribute the output]
    REP-50159:Executed successfully but there were some errors when distribute the
    output
    declare
    ERROR at line 1:
    ORA-20999:
    ORA-06512: at "NRSP.SRW", line 264
    ORA-06512: at "NRSP.SRW", line 799
    ORA-06512: at line 15

  • Can't send email to Hotmail and Yahoo ??

    Hello everyone,
    I tried to send email to my adress in Hotmail or yahoo and doesn't work. I have another POP address and it works perfectly. Anyone know what i have to do to send mail to Hotmail and yahoo. thank you for any reponse.
    Rania+

    and finally I receive the email
    which I have send 2 days before , so I don't know why
    it's take all this time, have you an idea about this
    ?What error do u get? Are u sending mail to valid addresses.
    Some mail servers keep trying to send mail for invalid addressfor specified amount of time. Whereas others reject mail straigt away.
    Are you using a valid mail server( sometimes mail servers may have differnt forward and reverse lookups whic may cause problem ) to send mails.

  • Calling form .fmx or report .rep from database trigger. (URGENT PL.)

    can we call an form (.fmx) or a report (.rep) from a database trigger. that is when there is some insertion in the table i want to call a report which will take the parameters from the table changed.
    regards
    vishal

    JDeveloper and ADF

  • Re: [Re: Keys retrieval from database]

    Hi Joseph,
    Thank you for your reply.I am using ODBC to connect Forte application with the database.And I went through the document, and tried all the possible ways, I could't succed in retrieval of whole data.I tried the sql execute procedure also.I will the error message
    after sometime.How does it related with escript?please clarify.
    Thank you,
    J.Babu
    [email protected] wrote:
    Hello Jendran,
    take a look at your 'Online-Help'. Search for 'DBDataType' (DBColumnDesc) and
    'GetDatabaseDesc' and look if your question is answered.
    See the 'Accessing Database Guide' Page 236 for a complete description of the
    call ('sql execute procedure' not 'sql execute Immediate procedure').
    Look wether you connect via ODBC or Direct to the database in your
    DBResourceMgr (Perhaps you have to look how this is specified in your
    environment in 'econsole'). If you have any more problems please copy
    the error-message in your email, to see what forte says to this error.
    Hope this helps
    Joseph Mirwald
    At 04:30 18.06.98, you wrote:
    Hi guys,
    Have any one used the method GetDatabaseDesc() of DbSession classto retrieve columns, primary keys and Foreign keys of a database? I
    couldn't retrieve any information except columns of MsSql server
    database.If possible give some information.
    I couldn't execute stored procedure from Forte, what could be theproblem? we tried with sql execute Immediate procedure.
    Thank you in advance,
    J.Babu
    Get free e-mail and a permanent address at http://www.netaddress.com/?N=1
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Babu,
    Note that though you will be able to get column information on
    most of the
    databases, some databases do not maintain or provide access to
    key
    information. For these databases, specifying DB_IN_KEYINFO and
    DB_IN_FOREIGNKEYINFO has no effect. Oracle, Ingres, and Informix
    do support key information. Check vendor documentation for
    other databases
    on specific platforms.
    As rightly mentioned by Joseph Mirwald, you might want to email
    a copy
    of the error message that you get.
    Good luck!
    Ajith Kallambella M.
    Forte Systems Engineer,
    Internationational Business Corporation.
    From: [email protected][SMTP:[email protected]]
    Reply To: [email protected]
    Sent: Thursday, June 18, 1998 12:30 AM
    To: [email protected]
    Cc: [email protected]; [email protected]
    Subject: Keys retrieval from database
    Hi guys,
    Have any one used the method GetDatabaseDesc() of DbSession
    class to retrieve columns, primary keys and Foreign keys of a
    database? I couldn't retrieve any information except columns of MsSql
    server database.If possible give some information.
    I couldn't execute stored procedure from Forte, what could be
    the problem? we tried with sql execute Immediate procedure.
    Thank you in advance,
    J.Babu
    Get free e-mail and a permanent address at
    http://www.netaddress.com/?N=1
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive
    <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Send JasperReport to the Email ID which takes values from ResultSet

    My objective is to send jasper report to different email ids which takes values from database.
    I have wrote the following code. However, it does not throw any error or exception and doesn't meet my objective.
    Jdev 11.1.1.5.0 ADF BC.
    public void dbConnect() throws Exception{
    String dbUrl = "jdbc:oracle:thin:@localhost:1521:testdb";
    String dbClass = "oracle.jdbc.driver.OracleDriver";
    String query = "Select * FROM testJob";
    Class.forName(dbClass);
    Connection conn = DriverManager.getConnection(dbUrl,"sahar","sahar");
    Statement statement = conn.createStatement();
    ResultSet resultSet = statement.executeQuery(query);
    String seqNo = null;
    Map reportParameters = new HashMap();
    Context env = (Context)new InitialContext().lookup("java:comp/env");
    String reportPath = (String)env.lookup("reportPath");
    String jrxmlFileName = reportPath+"testJob.jrxml";
    String jasperFileName = reportPath+"testJob.jasper";
    String pdfFileName = reportPath+"testJob.pdf";
    while(resultSet.next()){      
    String branchId = resultSet.getString(1);
    reportParameters.put("branchId", branchId);
    JasperReport jasperReport = JasperCompileManager.compileReport(jrxmlFileName);
    JasperPrint print = JasperFillManager.fillReport(jasperReport, reportParameters, conn);
    JasperExportManager.exportReportToPdfFile(print,pdfFileName);
    String subject = "Test with Attachment";
    Properties props = new Properties();
    props.put("mail.smtp.host", "10.0.0.237");
    Session session = Session.getInstance(props, null);
    MimeMessage message = new MimeMessage(session);
    String toAddresses = resultSet.getString(4);
    message.setFrom(new InternetAddress("[email protected]"));
    message.addRecipients(Message.RecipientType.TO, toAddresses);
    message.setSentDate(new Date());
    message.setSubject(subject);
    MimeBodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setText("Hi");
    Multipart multipart = new MimeMultipart();
    multipart.addBodyPart(messageBodyPart);
    messageBodyPart = new MimeBodyPart();
    DataSource source = new FileDataSource(pdfFileName);
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(pdfFileName);
    multipart.addBodyPart(messageBodyPart);
    message.setContent(multipart);
    }

    Hi,
    refer this threads:
    Re: Smartforms to PDF
    Re: smartform (otf) as pdf and sending as email-attachment
    rgds,
    latheesh

  • Trying to get Hotmail and Yahoo email on Palm Tungsten C

    Was very excited when I got this palm from ebay and read thru the instruction manual and have done a lot of searching but can't find the answer to this:  How do I get my hotmail and yahoo email to show up on my Tungsten C thru versamail. 
    For Hotmail Under Account Set up I have
    Account Name:  Hotmail
    Mail Service:  Other
    Protocol: POP
    synchronize only accounts unchecked
    User name my email address w/@hotmail.com
    Password:  Entered and it says Assigned
    Email address:  my email address
    Incoming mail Server: pop3.live.com
    outgoing mail server:  smpt.live.com
    Then it says "your hotmail account is completed...."
    incoming mail options:
    port number 995
    use secure connection (SSL) checked
    maximum message size 5KB
    Advanced outgoing options:
    Port Number: 25
    my server requires authentication (ESMTP) checked
    user name:  my email address w/ @hotmail.com
    and password entered and assigned
    When I hit done and click get mail it says "connecting to mail server" then times out after about 30 seconds. 
    Yahoo settings:
    Account Name Yahoo
    Mail service Yahoo (already in the Palm as a choice)
    Protocol:  Pop
    sync only account : unchecked
    username: my username w/out @yahoo.com
    password: entered and assigned
    Email address: autfilled
    incoming mail surver: pop.mail.yahoo.com
    outgoing mail server: smtp.mail.yahoo.com
    Incoming Mail Options:
    Port Number: 110
    User secure connection (ssl) unchecked
    Max msg size 5 KB
    Advanced Outgoing Options:
    Port Number 25
    My server requires authentication (ESMTP): checked
    User name: my user name
    Password: entered and says assigned
    When I click get mail it says "ERR[sys/perm] pop not allowed for user.
    I have no clue what I'm doing wrong or if its even possible but any help would be appreciated.
    Thanks!
    Post relates to: Tungsten C

    I just set up my Gmail account on my TX using Versamail, and it works seamlessly.  In the setup screen, US gmail is a service option to select, which then automatically prefills all of the server and security settings shown below.  The version of Versamail on your Tungsten C is older so it might not have all these options, but here are the settings:
    Account name: Gmail
    Protocol: Pop
    Username: your gmail username (just the name, not the @gmail.com)
    Password: your gmail password
    email address: [email protected]
    incoming mail server: pop.gmail.com
    outgoing mail server: smtp.gmail.com
    incoming server settings:
    Port number 995
    Use Secure Connection (SSL): check
    Use Authentication (APOP): uncheck
    outgoing server settings:
    port number: 25
    Use Secure Connection (SSL): check
    Use Authentication (ESMTP): check
    username: [email protected]
    password: your gmail password
    Those are all of the available settings in Versamail on the TX, which is Versamail version 3.1C
    Hope this helps.  If it doesn't work, you could see if SnapperMail will work.  It's a third-party email app which is very robust and has a free trial period before you buy.  Short of that, you might just have to upgrade to a newer device.
    smkranz
    I am a volunteer, and not an HP employee.
    Palm OS ∙ webOS ∙ Android

  • Pictures embedded in an email are not being displayed, hotmail and yahoo under FireFox of problem. Embedded pictures do appear with Explorer 10.

    Windows 8 / Explorer 10 / FireFox 21.
    Pictures embedded in an email aren't being displayed with either hotmail or yahoo mail running under FireFox 21. The embedded pictures do display with either hotmail or yahoo mail running under Explorer 10.

    Clear the cache and the cookies from websites that cause problems.
    "Clear the Cache":
    *Firefox/Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • After Logon on Database Trigger Not Working From Client Terminal

    Hi Every One
    I Have a Problem, I'am Using Oracle 10g R2, I'd Written After Logon on Database Trigger, I'd Written The Trigger Under The Under The User With DBA Privileges, and it is work Fine, but it is work only when i Logon On The Database from The Server Terminal with any user, and If Logon From any Other Terminal It Is Not Work,
    Can any One Know The Reason, Please Help me
    Yasser Mokhtar

    Please post the trigger code.

  • Can I execute a mapping from a database trigger ????

    Can anyone tell me if I can execute a mapping from a database trigger ? How ???
    Thanks in advance.----
    JEMD

    Hello,
    We are using the approach of scheduling predefined job heavily in our projects. It works fine.
    There are several points to mention:
    - scheduling / rescheduling algorithm must not lead to simultaneous session of the mapping run. Depending of content of the mappings/PF this could bring the real pain.
    - If there are several user sessions intensively interacting the table on which the scheduling trigger is created, scheduling / rescheduling algorithm must be written with care – users could lock or wait each other while updating job record.
    - Depending on intensity of such mapping runs additional care must be taken of OWB audit trail which will tend to grow.
    Depending on requirements trigger could call ordinal procedure for scheduling (if mapping run must be performed only if user commit change to the table), or procedure with autonomous_transaction pragma (if any touch of the table should fire the execution – don’t think this is a case)
    Sergey

  • Start Workflow from the After startup database trigger

    Hallo,
    I try to startup a workflow process from a database trigger :
    the after startup database trigger. But when I do this, he
    doesn't startup. When I add a commit-statement after the call
    to startup the workflow, my database never gets open.
    What do I have to do ? And what command is used ?
    Thanks a lot.
    Filip Huysmans.

    See the Posting: Starting Workflows From a Database Trigger
    Hallo,
    I try to startup a workflow process from a database trigger :
    the after startup database trigger. But when I do this, he
    doesn't startup. When I add a commit-statement after the call
    to startup the workflow, my database never gets open.
    What do I have to do ? And what command is used ?
    Thanks a lot.
    Filip Huysmans.

  • HT5570 I am not getting the verification email ... i changed from yahoo to a gmail for apple id...have sent it several times and I'm not receiving in gmail

    I am not getting the verification email ... i changed from yahoo to a gmail for apple id...have sent it several times and I'm not receiving in gmail

    Did you check your gmail account to see if it is working OK?
    Are you sure you didn't make a typo when you entered the gmail address as a change?

  • I updated my phone last Wed. and now I am not getting my emails pushed to my phone from yahoo.  What's the problem?

    I updated my phone last Wed with IOS 6 and now I am not getting my emails pushed to my phone from yahoo.  any idea why or how to fix this?

    you'll have to set it up as a new phone.  You have no choice.  If you've been using your phone as recommended, you should have little, if any, data loss.

Maybe you are looking for

  • SQL Error: ORA-01704: string literal too long

    select * from table(fn_split('some 10000 characters with comma separation .........................')) Error report: SQL Error: ORA-01704: string literal too long 01704. 00000 - "string literal too long" *Cause:    The string literal is longer than 4

  • Same color looks diffrenent in Illustrator and Photoshop?

    Hello! I need to convert a logo that I've made in Photoshop to an EPS-file using Illustrator. I've imported all the paths and filled them with the colors that I had in Photoshop. The colors I'm using in the logo is black, white and green. The black a

  • Problem in updating entries in Table Maintenance of custom table

    Hi Gurus, Need help. When I update existing entries in the table maintenance generator, they do not get updated after save. Is there a setting in data dictionary that causes this?

  • How to correctly add multiple iframe objects?

    I'm trying to load multiple iframes inside a symbol. I currently have 3. The way im setting them up goes like this: I have the iframe codes in the symbol actions: iframe code; rectangle name; iframe code; rectangle name; iframe code; rectangle mane;

  • Is Java blocked again?

    I was forced this morning to update to Java 7 update 17 from Oracle. Has update 13 before. Then it was working for a couple of hours but now its blocked again. I'm trying to run the installation again for Java 7 update 17 but i just get the message t