Home » Developer & Programmer » Forms » Send mail from forms and reports
Send mail from forms and reports [message #77555] Thu, 04 October 2001 13:25 Go to next message
sai
Messages: 27
Registered: October 2001
Junior Member
Hi,

Can anybody please tell how to send mails from forms 6i and reports 6i.

Thanks,
Sai

----------------------------------------------------------------------
Re: Send mail from forms and reports [message #77560 is a reply to message #77555] Fri, 05 October 2001 22:57 Go to previous messageGo to next message
Subhash
Messages: 105
Registered: October 2001
Senior Member
Try this Procedure

PROCEDURE send_email
( sendernm IN VARCHAR2,
senderid IN VARCHAR2,
recipient IN VARCHAR2,
subject IN VARCHAR2,
message IN VARCHAR2,
mailsrvr IN VARCHAR2)
IS
host VARCHAR2(30) := mailsrvr;
mail_conn utl_smtp.connection;
crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
msg VARCHAR2( 4000 );
BEGIN
mail_conn := utl_smtp.open_connection(host, 25);
msg:= 'Date: ' || TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' ) || crlf ||
'From: '||sendernm||'<' ||senderid||'>' || crlf ||
'Subject: '||subject || crlf ||
'To: '||recipient || crlf ||
'' || crlf || message;
utl_smtp.helo(mail_conn, host);
utl_smtp.mail(mail_conn, senderid);
utl_smtp.rcpt(mail_conn, recipient);
utl_smtp.data(mail_conn, msg);
utl_smtp.quit(mail_conn);
Exception
When others then
Null;
END;

sendernm - Name of Sender
senderid - E Mail Id of Sender
recipient - E Mail Id of Recipient
subject - Subject
message - Message
mailsrvr - Mail Server IP Addresss/Name

----------------------------------------------------------------------
Re: Send mail from forms and reports [message #77570 is a reply to message #77555] Mon, 08 October 2001 13:40 Go to previous messageGo to next message
N.N
Messages: 1
Registered: October 2001
Junior Member
You can create a button and call this procedure
PROCEDURE email IS

OutlookApp OLE2.OBJ_TYPE;
NameSpace OLE2.OBJ_TYPE; -- documents collection
Folders OLE2.OBJ_TYPE;
MailItem OLE2.OBJ_TYPE;
MailItem2 OLE2.OBJ_TYPE;
OLEPARAM ole2.list_type;
Send OLE2.OBJ_TYPE;
Attachments OLE2.OBJ_TYPE;
Attachment_dummy OLE2.OBJ_TYPE;
v_to varchar2(50) ;
v_cc varchar2(50) ;
v_body varchar2(250) := 'Attached is my weekly report =^-^= I have just learnt how to send an email with attachement through forms. This is so neat!';
v_bcc varchar2(50);
v_subject varchar2(50) := 'Weekly Status Report';

BEGIN

OutlookApp := OLE2.CREATE_OBJ('Outlook.Application');

-- Create a namespace
-- Think of this as the equivalent as the Documents Collection
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,'MAPI');
NameSpace := OLE2.INVOKE_OBJ(OutlookApp,'GetNameSpace',OLEPARAM);
OLE2.DESTROY_ARGLIST( OLEPARAM );

--Create a newMail Object
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,0);
MailItem := OLE2.INVOKE_OBJ(OutlookApp,'CreateItem',OLEPARAM);
OLE2.DESTROY_ARGLIST( OLEPARAM );

-- Show the new message box. - Dont do when mailing straight Through
-- MailItem2 := OLE2.INVOKE_OBJ(Mailitem,'Display');

ole2.set_property(MailItem,'To',v_to);
ole2.set_property(MailItem,'CC',v_cc);
ole2.set_property(MailItem,'BCC',v_bcc);
ole2.set_property(MailItem,'Subject',v_subject);
ole2.set_property(MailItem,'Body',v_body);

Attachments := OLE2.GET_OBJ_PROPERTY(MailItem,'Attachments');
--Adding an attachment
OLEPARAM := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(OLEPARAM,'c:tempWeeklyReport.doc');
Attachment_dummy := OLE2.INVOKE_OBJ(Attachments,'add',OLEPARAM);
OLE2.DESTROY_ARGLIST( OLEPARAM );

Send := OLE2.INVOKE_OBJ(Mailitem,'Send');

OLE2.RELEASE_OBJ( MailItem);
OLE2.RELEASE_OBJ( NameSpace );
OLE2.RELEASE_OBJ( OutlookApp );

END;

----------------------------------------------------------------------
Use stationery of outlook [message #79114 is a reply to message #77555] Sun, 28 April 2002 02:24 Go to previous messageGo to next message
Nisar Ibrahim
Messages: 3
Registered: April 2002
Junior Member
I want to use a particular background (can be an html or gif) for the emails i send from oracle forms. Can anyone help me in that please.
Re: Send mail from forms and reports [message #80290 is a reply to message #77560] Tue, 03 September 2002 22:04 Go to previous messageGo to next message
nazar
Messages: 5
Registered: August 2002
Junior Member
can we automate this after any condition violated then only trigger when-timer-expired and send the email and sms. I'm doing the checking for some conditions in Forms and wish to automatically send the sms whenever violation of condition occur to the support staff on standby during the period of the incident by accessing roster_dtl and roster_master tables.
Re: Send mail from forms and reports [message #81942 is a reply to message #77555] Thu, 03 April 2003 02:51 Go to previous message
qhung
Messages: 9
Registered: April 2003
Junior Member
Dear All,
If you don't mind, Pls. let me know about something :
- Version of Outlook Express & Oracle form ( I am using OE 5 & Form 5.0).
- I run the code post on forum and get the error ORA-305500.
- Pls. send me list of commands of Outlook Express, Property...if you can.

Best Regards.
Previous Topic: Humanity Crying In IRAQ
Next Topic: Send e-mail via Outlook Express from Oracle forms
Goto Forum:
  


Current Time: Thu Apr 25 23:45:30 CDT 2024