Sending mail from DB - receiving empty mail

Guys - Hope you doin well -
I have a problem - i am sending mail from my db - i am using oracle 9i -
the mail successfully sent to the receipent but with out any message - Below is the code that i am using to send mail -
please help -
create or replace package email is
procedure send_mail(pi_frmadd in varchar2,
pi_tooadd in varchar2,
pi_subjct in varchar2,
pi_msg in varchar2,
pio_status in out nocopy varchar2);
end email;
show err
create or replace package body email is
g_maicon utl_smtp.connection;     
procedure open_mail_server(pio_status in out nocopy varchar2) is
l_maihst varchar2(100) := 'localhost';
-- mail server IP address/name, instead of hardcoding this can be made a system parameter.
begin
pio_status := 'OK';
g_maicon := utl_smtp.open_connection(l_maihst);
utl_smtp.helo(g_maicon, l_maihst); -- perform initial handshake.
exception
when others then
pio_status := substr(sqlerrm, 1, 200);
end open_mail_server;
procedure close_mail_server(pio_status in out nocopy varchar2) is
begin
pio_status := 'OK';
utl_smtp.quit(g_maicon);
exception
when others then
pio_status := substr(sqlerrm, 1, 200);
end close_mail_server;
procedure send_mail(pi_frmadd in varchar2,
pi_tooadd in varchar2,
pi_subjct in varchar2,
pi_msg in varchar2,
pio_status in out nocopy varchar2) is
errexc exception;
begin
--< open connection >--
pio_status := 'OK';
open_mail_server(pio_status);
if pio_status != 'OK' then
raise errexc;
end if;
--< assign from and to >--
utl_smtp.mail(g_maicon, pi_frmadd);
utl_smtp.rcpt(g_maicon, pi_tooadd);
--< create message text >--
utl_smtp.open_data(g_maicon);
utl_smtp.write_data(g_maicon, 'From: "' || pi_frmadd || '"<'
|| pi_frmadd || '>' || utl_tcp.crlf);
utl_smtp.write_data(g_maicon, 'To: "' || pi_tooadd || '"<'
|| pi_tooadd || '>' || utl_tcp.crlf);
utl_smtp.write_data(g_maicon, 'Subject: ' || pi_subjct || utl_tcp.crlf);
utl_smtp.write_data(g_maicon, pi_msg);
utl_smtp.close_data(g_maicon);
--< close connection >--
close_mail_server(pio_status);
exception
when errexc then
return;
when others then
pio_status := substr(sqlerrm, 1, 200);
end send_mail;
end email;
show err
--Cut-paste the below code and execute it to send email from Oracle.
--Specify the receipent e-mail ids.
set serverout on size 1000000
declare
l_frmadd varchar2(100) := '[email protected]';
l_tooadd varchar2(100) := '[email protected]';
l_subjct varchar2(100) := 'Cool Oracle mail';
l_msg varchar2(500) := 'You have received this mail from the database server BINGO!!' ||
utl_tcp.crlf || 'Checking if the content is acceptable!!!' ;
l_status varchar2(200);
begin
email.send_mail(l_frmadd, l_tooadd, l_subjct, l_msg, l_status);
dbms_output.put_line(l_status);
end;
Your earlier replys would be highly appreciated - because this is some sort of an urgent request and i can't figure it out what is the problem - please consider ..
YV.

Vohra,
Take a look at this AskTom thread -
http://asktom.oracle.com/pls/ask/f?p=4950:8:17145199247327995192::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:255615160805
It details how to use the utl_smtp package to send emails.
I have to ask however, since you're not doing anything 'fancy' like adding email attachments, why aren't you using the (much simpler) htmldb_mail package to send email?

Similar Messages

  • Hi,  I have just set up my domain email address with google and Im trying to set up mail on my mac.  Its receiving mail but its not letting me send emails from that address.  I have tried quite a few solution but cant figure it out.  Can anyone help

    Hi,  I have just set up my domain email address with google and Im trying to set up mail on my mac.  Its receiving mail but its not letting me send emails from that address.  I have tried quite a few solution but cant figure it out.  Can anyone help

    Hi Lawrence1981,
    Thanks for visiting Apple Support Communities.
    You may want to check this article for additional troubleshooting steps:
    OS X Mail: Troubleshooting sending and receiving email messages
    http://support.apple.com/kb/ts3276
    Cheers,
    Jeremy

  • HT204075 I am not receiving mail to one of my email accounts. I can send mail from this account and all other accounts seem to be working.

    I am not receiving mail to one of my email accounts. I can send mail from this account and all other accounts seem to be working.

    Is this work email account on a BES server?
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • I am using i pad mini. I am going through a issue in which i am not able to send mails to my work email add wherein i am able to receive emails from same email id.

    i am using i pad mini. I am going through a issue in which i am not able to send mails to my work email add wherein i am able to receive emails from same email id.

    With one mailbox server in the production site and one in the DR site, you do not have high availability.  If the main site goes down, the cluster loses quorum and all databases dismount.  You must then force quorum or move the file share
    witness to restore quorum.
    I can't tell you why what you observed happened.  At the time of the problem I would have been looking at the transport queues to see what's queued and to where.
    I recommend you look at the configuration of your send connectors to ensure that none of them are dependent upon the DR site server.
    To send mail outside, you must allow relay.  To do this, I recommend you create a new receive connector that's configured to allow relay and restrict access to the application server to keep anyone else from using it to relay.  There are plenty
    of articles on the Internet that describe how to configure a relay connector.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • I can't send mails from my outlook 2010 but can receive, I can't send mails from my outlook 2010 but can receive

    I can't send mails from my outlook 2010 but can receive, please help.

    Thank you so much for your time and help Csound1 I really appreciate it.
    Mac mail works perfectly fine so I don't want to screw it up by altering anything there.
    However, I've checked to make sure I didn't miss anything on Outlook, but it still won't send messages. I don't know if I need to fill the "Unqualified domain" field?

  • I have used Firefox for many years. Now I can receive E-mail but cannot send it from Firefox. Just re-installed Mozilla and still cann't send E-mail.....

    I cannot send mail from Firefox. Can receive E-mail but cannot send it. This worked OK until today. I have had firefox for many years. Just reinstalled Mozilla and still cannot send E-mail from firefox.
    I use comcast.net for E-mail,using Mozilla to get there.

    If your Office email account's SMTP authenticated?
    Any error message provided and if so, what?
    Are you also accessing an email account and SMTP server provided by SBCGlobal.net with either email client and if so, are you able to send messages with this account and SMTP server when connected to the internet via SBCGlobal.net at home?
    And let me get this straight - both email clients work fine without any problems sending messages with your Office email account and SMTP server when connected to the internet at a friend's house that uses another ISP besides SBCGlobal.net but this is an Apple problem?
    If an Apple problem, then you'd have problems sending messages with this account and SMTP server regardless whose network and ISP you are connected to.
    Regardless what this more than likely under-trained or just unaware person at SBCGlobal.net told you, all ISPs have restrictions on using an SMTP server that is outside of their network or that isn't provided by the ISP used for connecting to the internet.
    Some ISPs allow the use of an authenticated server only that is outside of their network but some block its use regardless.
    Within the last year or so, SBCGlobal.net made a drastic change in regards to such restrictions and conveniently neglected to inform their customers beforehand. Those using an SMTP server that was outside of SBCGlobal.net's network regardless if the SMTP server was authenticated were required to "opt out" of Port 25 blocking with SBCGlobal.net in order to use an SMTP server that was outside of their network which was working fine before this change was made.
    Have you opted out of Port 25 blocking with SBCGlobal.net?

  • Why can I Only send mail from my iCloud Account and none of my others yet can receive from all ?

    why can I Only send mail from my iCloud Account and none of my others yet can receive from all ?

    Morning Allan ,sorry hit the wrong button. Thank you for responding . Meant to reply not notify you that my issue was solved . It's not . I imported all my settings via iTunes and all of the accounts receive mail as I said but can't send . Can you tell me exactly what to change with regard to my outgoing smtp. and PE the authentication ?

  • Sending mails from sap to receiver

    Hi,
    could someone give simple sample of code which will send mails from sap to receiver.
    How to collect data from tables to be send?
    I have three field with data: task, notes, price, how to make that data will be in mail for example in this way:
    task: ............ &task&.
    notes: ......... &notes&.
    price: ......&price&.
    Regards,
    Joanna.

    U can use the FM 'SO_NEW_DOCUMENT_ATT_SEND_API1' for sending the list to a mail id configured to outlook
    Have a look at the links below. will get detailed information;
    SEND EMAIL FROM SAP
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    Check these link..
    Cofiguration:
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    Sample Code:
    http://www.sap-img.com/abap/sending-email-with-attachment.htm
    Reward points if this Helps

  • TS3899 I am having issues with both my iPad and iPhone 5C in trying to send email from my home email account. It will receive email but I can't send email, each time I try an error message comes up.  The error message is: Cannot Send Mail; Acopy has been

    The error message that is received is: Cannont Send Mail; A copy has ben placed in your Outbox. The recipient [email protected] was rejected by the server.
    Is this a problem in the way the accounts have been set up or with my local email server?

    Check the parameters in your email account against what is recommended by your email provider.
    Settings > Mail, Contacts, Calendars > account
    Have you contacted the support contact at your email provider?

  • TS2621 I cannot SEND email from iPad but I can RECEIVE email!  ERROR message says "your email has been placed in your outgoing mail box.

    Why will my iPad not SEND email but will receive email?

    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    Server does not allow relaying email error, fix
    http://appletoolbox.com/2012/01/server-does-not-allow-relaying-email-error-fix/
    Why Does My iPad Say "Cannot Connect to Server"?
    http://www.ehow.co.uk/info_8693415_ipad-say-cannot-connect-server.html
    iOS: 'Mailbox Locked', account is in use on another device, or prompt to re-enter POP3 password
    http://support.apple.com/kb/ts2621
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Configuration problems with IMAP e-mail on iOS with a non-standard SSL port.
    http://colinrobbins.me/2013/02/09/configuration-problems-with-imap-e-mail-on-ios -with-a-non-standard-ssl-port/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
     Cheers, Tom

  • TS4605 why cant i receive mail on my ipad from icloud, but I can send mails?

    Why can't I recieve mails on my ipad from icloud?  I can send mails no problems there.  This has only recently happened before it was working fine.  When I go to check for new mails I get the following message: Cannot Get Mail  The connection to the server failed.  Please help, this is very fustrating.

    I can hear that frustration for sure. I deal with it every day.
    I would continue to push the landline provider over and over and over. They provide you with the landline service. They cannot complete the call to your cell phone. Everyone else can. Therefore it is their responsibility to make it work or at least give you a reasonable detailed explanation as to why it doesn't work so you could at least take the next appropriate steps. Do you have a trouble ticket number with the landline provider? Make sure they give you a trouble ticket number if you don't. Without a trouble ticket number you will have to continually repeat yourself every time you call them. With a ticket number every time you call you could tell the technician to reference that ticket number.
    Like I said when you're talking with someone in a managerial position request that they do call traces while you are making the call from the landline in real time. They should be able to see what happens to the call as it comes into and leaves their network. If they give you any call clearing or failure codes please document them and repeat them here.
    I would also ask the Rep to also make a test call to your cell phone and see what happens. If they can and you can't then it is clearly a problem with a switch on their network.
    Good luck.
    P.s. I typed this whole message using dictation on my iPhone five so hopefully it all came out right if not I apologize if it sounds confusing.

  • I have 5 email accounts.  On one account I receive email, however, in responding to the email from this one account I get the following message "Cannot send Mail" A copy has been placed in ur outbox.  The recipient was rejected by the server?

    when I respond to the email message I get the following:  Cannot Send Mail  -- A copy of this message has been placed in your Outbox.  The recipient "[email protected]" was rejected by the server?

    when I respond to the email message I get the following:  Cannot Send Mail  -- A copy of this message has been placed in your Outbox.  The recipient "[email protected]" was rejected by the server?

  • I have snow leopard.  Using iCloud, I an receive mail on my mac, but suddenly, I am no longer able to send email from the mac.  I can still send it from the icloud web site.  How do I regain the ability to send email from the mac?

    I have snow leopard.  Using iCloud, I can receive email on my mac, but, suddenly, I am no longer able to send email from the mac.  I can send it from iCloud online.  Any thoughts on how to regain the abilty to send email from my mac?  Thanks.

    Install ClamXav and run a scan with that. It should pick up any trojans.   
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101

  • I can receive but not send mail from remote wifi connections

    i cna recieve but not send email from remote wifi locations

    Check with your email provider for their smtp settings when using a remote Internet connection.

  • No Mail. I can not get or send mail from my iPhone,iCloud, or mail  on the desktop. Password is correct i can get into iCloud but not able to get mail.

    I can not get or send mail from my iPhone, iCloud, and desktop mail.  All are the same account, password is right and working. When the problem first happened I updated to a new  password.
    The Mail and the phone are telling me ( "The iCloud IMAP server “p99-imap.mail.me.com” rejected the password for user “k****n******2”}
    From the iCloud account i get a message saying  mail could not be loaded and the details. Which i have copyed below.
    Any thoughts or anyone I can ring ? This was a paid for mobile me account.
    Thanks
    Running 10.72
    ORIGIN
    server
    TYPE
    error
    BUILDNUMBER
    1FCS29.34215
    TIME
    Sun Dec 11 2011 10:49:50 GMT+0000 (GMT)        (1323600590380)
    HOST
    www.icloud.com
    USERAGENT
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2) AppleWebKit/534.52.7 (KHTML, like Gecko) Version/5.1.2 Safari/534.52.7
    PRSID
    217870346
    RECENTLOGMESSAGES
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: MAIL in main()
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: -->  Request 1:   POST to https://p99-mailws.icloud.com:443/wm/preference,  headers: Content-Type=text/plain,  body: (omitted)
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: Request out: /wm/preference-list-->1323600562085/1
              params: {"locale":"en-us","timeZone":"Europe/Dublin"}
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: SC.Object:sc1074:dispatch('load content')
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: "2.0 Waiting for Content" handled event 'load content' (no transition)
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: SC.Module: Attempting to load 'addresses'
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: SC.Module: Module 'addresses' is not loaded, loading now.
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: SC.Module: Loading JavaScript file in 'addresses' -> '/applications/mail/frameworks/addresses/en-us/1FCS29/javascript.js'
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: SC.Object:sc3099:initStatechart()
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: -> entering "9 Address List Not Visible"
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: -->  Request 2:   GET to https://p03-contactsws.icloud.com:443/co/addressbook/?order=first,last&locale=en _US,  headers: Content-Type=text/plain,  body: (omitted)
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: SC.Module: Module 'addresses' finished loading.
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: SC.Module: Evaluating and invoking callbacks for 'addresses'.
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: SC.Module: Module 'addresses' has completed loading, invoking callbacks.
    Sun, 11 Dec 2011 10:49:22 GMT:  DEBUG: APPLICATION: Received applicationWillBecomeActive
    Sun, 11 Dec 2011 10:49:23 GMT:  WARN:  APPLICATION: Received applicationDidBecomeActive
    Sun, 11 Dec 2011 10:49:23 GMT:  DEBUG: <--  Response 2:  200  (1257ms),  headers: Cache-Control=no-cache, no-store, private, Content-Type=application/json; charset=UTF-8  body: (omitted)
    Sun, 11 Dec 2011 10:49:25 GMT:  DEBUG: willReceive: Status:500, Request:/wm/preference
    Sun, 11 Dec 2011 10:49:25 GMT:  DEBUG: Got HTTP 500 : Redirecting request: /wm/preference : Redirect count:1
    Sun, 11 Dec 2011 10:49:25 GMT:  DEBUG: -->  Request 3:   POST to https://p99-mailws.icloud.com:443/wm/preference,  headers: Content-Type=text/plain,  body: (omitted)
    Sun, 11 Dec 2011 10:49:25 GMT:  DEBUG: Request out: /wm/preference-list-->1323600562085/1
              params: {"locale":"en-us","timeZone":"Europe/Dublin"}
    Sun, 11 Dec 2011 10:49:29 GMT:  DEBUG: willReceive: Status:500, Request:/wm/preference
    Sun, 11 Dec 2011 10:49:29 GMT:  DEBUG: Got HTTP 500 : Redirecting request: /wm/preference : Redirect count:2
    Sun, 11 Dec 2011 10:49:29 GMT:  DEBUG: -->  Request 4:   POST to https://p99-mailws.icloud.com:443/wm/preference,  headers: Content-Type=text/plain,  body: (omitted)
    Sun, 11 Dec 2011 10:49:29 GMT:  DEBUG: Request out: /wm/preference-list-->1323600562085/1
              params: {"locale":"en-us","timeZone":"Europe/Dublin"}
    Sun, 11 Dec 2011 10:49:33 GMT:  DEBUG: willReceive: Status:500, Request:/wm/preference
    Sun, 11 Dec 2011 10:49:33 GMT:  DEBUG: Got HTTP 500 : Redirecting request: /wm/preference : Redirect count:3
    Sun, 11 Dec 2011 10:49:33 GMT:  DEBUG: -->  Request 5:   POST to https://p99-mailws.icloud.com:443/wm/preference,  headers: Content-Type=text/plain,  body: (omitted)
    Sun, 11 Dec 2011 10:49:33 GMT:  DEBUG: Request out: /wm/preference-list-->1323600562085/1
              params: {"locale":"en-us","timeZone":"Europe/Dublin"}
    Sun, 11 Dec 2011 10:49:37 GMT:  DEBUG: willReceive: Status:500, Request:/wm/preference
    Sun, 11 Dec 2011 10:49:37 GMT:  DEBUG: Got HTTP 500 : Redirecting request: /wm/preference : Redirect count:4
    Sun, 11 Dec 2011 10:49:37 GMT:  DEBUG: -->  Request 6:   POST to https://p99-mailws.icloud.com:443/wm/preference,  headers: Content-Type=text/plain,  body: (omitted)
    Sun, 11 Dec 2011 10:49:37 GMT:  DEBUG: Request out: /wm/preference-list-->1323600562085/1
              params: {"locale":"en-us","timeZone":"Europe/Dublin"}
    Sun, 11 Dec 2011 10:49:40 GMT:  DEBUG: willReceive: Status:500, Request:/wm/preference
    Sun, 11 Dec 2011 10:49:40 GMT:  DEBUG: Got HTTP 500 : Redirecting request: /wm/preference : Redirect count:5
    Sun, 11 Dec 2011 10:49:40 GMT:  DEBUG: -->  Request 7:   POST to https://p99-mailws.icloud.com:443/wm/preference,  headers: Content-Type=text/plain,  body: (omitted)
    Sun, 11 Dec 2011 10:49:40 GMT:  DEBUG: Request out: /wm/preference-list-->1323600562085/1
              params: {"locale":"en-us","timeZone":"Europe/Dublin"}
    Sun, 11 Dec 2011 10:49:44 GMT:  DEBUG: willReceive: Status:500, Request:/wm/preference
    Sun, 11 Dec 2011 10:49:44 GMT:  DEBUG: <--  Response 7:  500  (4248ms),  headers: Content-Type=text/html  body: (empty)
    Sun, 11 Dec 2011 10:49:44 GMT:  DEBUG: Request in: /wm/preference-list-->1323600562085/1,500,4249ms
    Sun, 11 Dec 2011 10:49:44 GMT:  DEBUG: ServerPreferencesDataSource.retrieveResponse error = -1/500/guid=serverPrefsGuid
    Sun, 11 Dec 2011 10:49:44 GMT:  ERROR: CoreMail handled error 13002 before exiting Mail

    Spent at least 40 min talking to apple support, to sort it out. luckly not at my cost. After trying lots of things and speaking to a higher grade support person I was given a temp password which did the trick. I then was able to reset that with my own password. 
    The impression i got was no one knowns  what the problem is and resetting the password at the apple end works. Not sure if you would be able to self fix.

Maybe you are looking for

  • Two users in the same Mac accessing one TimeCapsule

    Hi, How can i make two user accounts in the same Mac access simultaneously the same TimeCapsule? I've tried setting them to use accounts to connect to TimeCapsule as well as using a single password for TimeCapsule. But i keep having the same problem.

  • IDOC_ADAPTER ATTRIBUTE_WRONG_INTF

    Hi Experts,    I have a scenario where, i want to create as many number of IDOCs as the number of rows in the source XML. For this i have done the following. 1)I have exported the XSD schema of the IDOC. 2)I have changed the occurances to Unbounded.

  • Intercompany STO with billing through a third plant

    Hi I have the following scenario: Stock transfer happens between 2 plants in 2 different company codes and billing happens through a third Plant which is in a 3rd company code. The supplying plant delivers the goods to the destination Plant and bills

  • How to close a popup window for system events?

    Hi, I have a screen 110 which shows several input field in popup mode. The Cancel button can close the screen. But my question is how to close the popup window for the following system events? 1, Customer clicks the cross button in top-right corner 2

  • Upgrading computers wanting to use same backup

    I just upgraded to a MacPro from a PowerPC G5. I did the Migration (took approx. 6 hours) and although right before one minute from finishing, I got a message saying that computers had lost connection (which was not true). I had to turn computer off.