Sending an Email from within an Oracle Package

Hi,
I am trying to send an email from within a Oracle package Body. The code i have to do this is as follows: -
PROCEDURE send_mail(sender_in IN VARCHAR2,
recipient_in IN VARCHAR2,
date_from_in IN VARCHAR2,
date_to_in IN VARCHAR2) IS
-- Procedure to send e-mail
mailhost VARCHAR2(30) := '192.168.2.6';
crlf VARCHAR2(2) := CHR(13)||CHR(10);
--message VARCHAR2(32767);
message LONG;
mail_conn utl_smtp.connection;
reply VARCHAR2(512);
BEGIN
mail_conn := utl_smtp.open_connection(mailhost, 25);
message := 'Date: '||TO_CHAR(SYSDATE, 'DD-MON-YY HH24:MI:SS')||crlf||
'From: <'||sender_in||'>'||crlf||
'Subject: ''Holiday Request'||crlf||
'To: '||recipient_in||crlf||
utl_smtp.helo(mail_conn, mailhost);
utl_smtp.mail(mail_conn, sender_in);
utl_smtp.rcpt(mail_conn, recipient_in);
utl_smtp.data(mail_conn, message);
utl_smtp.quit(mail_conn);
EXCEPTION
WHEN others THEN
RAISE;
END send_mail;
end holidays;
I have one question though. I am getting a ORA-29278 SMTP Transien Error: 421 Service Nota Available Error. I think this may be due to the 'Mailhost' value I have given in the above code. I have been informed that this should be the ip address of the mail server used or the ip address of the machine if it is being run locally. What would i need to put in here if i wish for an email to be sent from one hotmail address to another for example?
Any help would be much appreciated!
Thanks!
Darren

hi
The funnier part is that
u can actually type in the sender's email id irrespective of the mail host used
Like @hotmail.com,@yahoo.com etc.
The receiver will get the mails from the email id that u wrote .
The problem u r facing is becoz of the incorrect mail host server ip address
Try to get in touch with the network admin for the mail server ip address
other way is
get the name it would be like
smtp.domain name .
hope that helps

Similar Messages

  • Cannot send an email from within contacts on iPhone

    I’m trying to send email from within my contacts list app on my iPhone but the send button will not highlight and therefore cannot be pressed to send the email.   Sending email from the mall app works fine. Anyone know why this is happening?

    That also occurs for me and looks like a bug. The problem seems to be that, although the "To" address appears in the draft email, the iPhone does not think that it is there and won't activate the Send button. If one simply touches the "To" field the address disappears.
    Submit this as a bug at http://www.apple.com/feedback/iphone.html

  • Sending an email from within a program

    Hi,
    I am using SO_DOCUMENT_SEND_API1 to send an email from a program. Everything works fine, but the users don't want to see the popup message titled 'SAPconnect Send Process - List of Sent Objects'.
    Is there anyway I can supress this message from the program, or is it a setting in SAPconnect?
    Thanks
    Lindy

    If your are calling RSCONN01 after your function module then remove the submit of RSCONN01. This program will run scheduled every 1 to 5 minutes anyway as background job by the basis .

  • Exporting activity data as a PDF / sending as email from within package

    Hello,
    We are currently developing an E-learning package which involves the learners building up a check list on an "ipad" as they go through the course, which we would like them to then be able to save at the end of the course so they can review it later.
    We've managed to implement a print function, however we really need them to be able to save this data in some way.  Does any one know how we could push this data back to the LMS so it can somehow be downloaded and saved (in a good, branded format) or even better how we could make it into a PDF so it can be saved from with in the SCORM package or even in some way emailed.
    Any help would be much appreciated.
    Sam

    hi
    The funnier part is that
    u can actually type in the sender's email id irrespective of the mail host used
    Like @hotmail.com,@yahoo.com etc.
    The receiver will get the mails from the email id that u wrote .
    The problem u r facing is becoz of the incorrect mail host server ip address
    Try to get in touch with the network admin for the mail server ip address
    other way is
    get the name it would be like
    smtp.domain name .
    hope that helps

  • Sending an email from my database

    Hi!
    I wanna send an email from within a procedure from my database, Im thinking of using the utl_smtp package, I know I need acces from my database server to the smtp server, that can be done... when u use the utl_smtp package u need to specify the smtp host, the email address of the sender, the email address of the receptor, and some other stuff, what I wonder is: Where do u specify the password of the email address of the sender?, I mean, it doesnt make sense that u use an email address to send an email and u dont specify the password of that account
    In all the samples Ive seen all over internet I havent found something that tells me something about it...
    Any Help???

    A lot of smtp servers do not require a username/password when sending mail, only when receiving mail.
    If you need verification, you can do it with utl_smtp:
    utl_smtp.command( conn, 'AUTH LOGIN'); 
    utl_smtp.command( conn, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( cuser ))) ); 
    utl_smtp.command( conn, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( cpassword ))) ); 

  • Send email from within apex 2.1 application

    Hello,
    I like to send email from within apex application. I use oracle 10g xe with apex 2.1
    thx for advice
    Edited by: wucis on Feb 27, 2012 11:49 AM

    That is a very old version indeed. The documentation for sending emails from Apex 2.2 is here:
    http://docs.oracle.com/cd/B31036_01/doc/appdev.22/b28550/advnc.htm#BABJHJJF

  • Cannot send email from within iPhoto

    Using OX X 10.7.5 cannot send email from within iPhoto.  I get this error message: "Your email did not go through because the server did not reply."
    If I change the preference to use email, everything goes fine but I lose the formatting feature.

    iPhoto Menu ->
    Preferences ->
    Accounts ->
    Delete and recreate your email settings.
    Alternatively, use Apple's Mail for the job. It has Templates too - and more of them. Check out the Stationery...

  • I am no longer able to send emails from within iPad apps.

    I always used to be able to send files with attachments by email from within iPad apps like Adobe Reader or Pages. Used to work but now it doesn't - and this for all apps all at once. It gets to the point where it has prepared the email, but if you press send, it says "Could not save or send message". It also doesn't matter which email account I use - result always the same. It's a real pain as this was a good way of editing a word file and then emailing it to myself.

    Try a reset: Simultaneously hold down the Home and On buttons until the device shuts down. Ignore the off slider if it appears. Once shut down is complete, if it doesn't restart on it own, turn the device back on using the On button. In some cases it also helps to double click the Home button and close all apps from the tray BEFORE doing the reset.

  • Can Sales send Eloqua template emails from within SalesForce?

    Is there an out of the box solution for sales people to send a marketing template email from within SalesForce?
    Can Sales select multiple contacts and send them the Eloqua email from within SalesForce?
    Thanks
    Juan

    Have you tried using a mailto link on the form. We have found that this is accomplishes a lot of what F9 did in SOP. What you don't get is multiple templates, as the template is defined when you create the web link.
    Greg.

  • How to send ENCRYPTED email from 10v2

    Helllo,
    How to send ENCRYPTED email from 10v2 to end users who will receive their emails from Microsoft Outlook?
    I created a stored procedure to change user passwords. I need to email the users their passwords but the email message has to be encrypted since it contains user passwords. How do I use util_mail to send encrypted messages? The users will pick up their passwords through Microsoft Outlook. Thank you in advance.

    not sure what is the mechanics of decrypting (PGP maybe?)
    I have few tips ...
    1. look at DBMS_CRYPTO package
    2. create JAVA stored procedure (I'm sure there are some good samples to use java for encryption) to encrypt the body (this can be executed from pl/sql)
    3. save the body as a file on unix and encrypt it with unix command (this can be executed from PL/SQL utilizing UTL_FILE and JAVA stored procedure)
    4. forget sending the password in email and save the password on Oracle Apex site and configure access using single sign-on with transparent windows authentication

  • How to send only email from workflow

    Hi Guys,
    I want to send an email from a workflow without sending a notification ... how do i do it ?
    Thanks In advance
    Tom.

    Hi,
    Two possible ways - neither of which I would recommend.
    1 - Write a trigger on the WF_NOTIFICATIONS table, so that if the notification for the process that you require is sent, then you populate the mailer status column to 'spoof' the mailer into thinking that it has already sent it. That should suppress the email.
    2 - Modify the flow to include an activity prior to the notification to change the recipient preferences to not receive email, send the notification, then change the preferences back.
    Email is an "all or nothing" solution - either get email from everything, or get it from nothing. How are they planning on dealing with the notification that they are sent? If they are logging into the application to view the notification, then you could consider sending summary notification emails, and force the users to log into the application to view them all, rather than trying to adopt a half-and-half solution where some things come by email and some only come in the application.
    HTH,
    Matt
    WorkflowFAQ.com - the ONLY independent resource for Oracle Workflow development
    Alpha review chapters from my book "Developing With Oracle Workflow" are available via my website http://www.workflowfaq.com
    Have you read the blog at http://thoughts.workflowfaq.com ?
    WorkflowFAQ support forum: http://forum.workflowfaq.com

  • Sending RTF Emails from PLSQL To Outlook

    Hi,
    I am currently attempting to send an email from a plsql program to a Microsoft Outlook program in rtf format as I need the email to be in a particular format. I am using utl_smtp to do this along with rich text format codes. Unfortunately Outlook does not recognise the fact that the resulting email file is in rtf format and displays the item as plain text (i.e. it displays the codes).
    Is there any way that Oracle can force Outlook to accept this format ? I've tried adding application/rtf as the mime type in the connection string but all this does is send the email as a word attachment when really what we need is for the email body to be in rtf format.
    Thanks in advance,
    Paul.

    Hi,
    I think you will find this is not an Oracle problem. Outlook uses the mime type to decide which application to open it with. The associations between types and applications are buried somewhere in the registry. And if it's not the mime type, it's the 3 letter extension that's used (but you didn't say what extension you were giving the attachment).
    If you just open a .rtf file on this computer, the one with Outlook on, by double clicking it, what application does Windoze use to open it? I bet you will find it's Word.
    HTH
    Chris

  • Can't email from within iPad apps

    On my iPad w/Retina, I am unable to send email from within an application. Within Pages, for example, trying to email a document produced a "Couldn't send or save message" dialog. From within my NYT app, trying to email an article link produces "The operation could not be completed. (MFMailComposeErrorDomainError1.)" IPad's native mail app works fine.
    Any thoughts?

    Just got a reply to the same question in a different post, but it still doesn't tell me how to actually solve the problem, somstill waiting. See if this helps you:
    Douglas Johnson1
    Re: Why can't I send Emails from iPad apps?
    09-Jul-2013 15:29 (in response to Louises)
    I fixed this problem.  In my case I was using the GMail app and I NEVER used Apple's Mail app that came with my iPad.  So I had been checking all my settings for the Gmail app and I was ignoring the settings on Apple's Mail app.  It turns out that even if you never use Apple's Mail app, other apps DO use Apple's Mail app when they send Email from within their repsective applications. 
    So I'm guessing you aren't using Apple's Mail app and you've therefore ignored the settings on that app.  Fix all those settings and you should be fine.

  • Send out Email from Procedure

    Within a PL/SQL stored procedure, if an execution error occurrs, I want to receive a corresponding email to notify me as such. How can I do it?
    procedure p_exe_error(
    begin
    //If there is an error, send email to [email protected] to notify the error (error_message =xxxxxxxxxx)
    What should I do here?
    end;
    Thanks
    Scott

    This appears to be a duplicate
    Send out Email from Procedure
    Justin

  • Sending an email from forms

    hi all,
    i need your help.i.e how to send an email from forms .we actually want that facility in our project.we are trying for that but not yet geting .please help me giving information about email in forms.
    thank you in advance

    If you are using Forms on the web, one of the most easiest way to do it is to use the Java mailing support from sun. You can load it into the rdbms 8i or later and use it. There is a step by stepp detailed description on
    www.oracle.com > publications > Oracle Magazine > Ask Tom. If you just type java mail it will be between the first ten I suppose, it's a popular topic.
    HTH,
    Tamas

Maybe you are looking for

  • Error while Check-in DC's on NWDI: No Prefix found for DC

    Hi, I receive the following error when I try to check-in a CAF DC creation activity on the DTR. FAILED: No prefix found for development component "vendorname/name_A/caf/dictionary". Appropriate development component prefix should be configured in SLD

  • XPATH-expressions and namespaces

    I have a xml-file for testing my xpath expression, like this: <a>    <b>       <c>aaa</c>          <d>             <e>111</e>          </d>    </b>    <b>       <c>bbb</c>          <d>             <e>222</e>          </d>    </b>    <b>       <c>ccc<

  • How to play a FLV file located in a second FMS?

    How to play a FLV file located in a second FMS not directly accessible by the flash client? - I am publishing an audio stream from the flash client to a FMS; - This FMS then publishes the stream to a second FMS, which records the stream to a FLV; How

  • Quick preview/ How do I disable Hot&coldSpotw

    Hi, in the first version of Aperture I had no Hot&Coldspots in my Quickpreviews. Now I do have this al the time in Aper 3. How can I shut this off. I only would like to have this in my normal view.

  • Workstations not updating

    Hi I have few workstations that are not updating, I have re-install and Install but nothing seem to be working, I have rebooted and still no change, what could be the cause of these machines not to update? I am still very new on FEP and I would realy