|
Re: how can i send sms and mail through form 6i [message #543933 is a reply to message #543932] |
Fri, 17 February 2012 14:31 |
|
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
here is your solution do it cheer ---Enjoy
Take 3 text fields on canvas
1. TO VARCHAR2(30)
2. SUBJECT VARCHAR2(30)
3. BODY VARCHAR2(500);
Make one Button with name of "Send" and write trigger when-button-presssed type this in it.
DECLARE
--PROCEDURE SendMail
objOutlook OLE2.OBJ_TYPE;
objMail OLE2.OBJ_TYPE;
objArg OLE2.LIST_TYPE;
BEGIN
objOutlook := OLE2.CREATE_OBJ('Outlook.Application');
objarg := OLE2.CREATE_ARGLIST;
OLE2.ADD_ARG(objarg,0);
objMail := OLE2.INVOKE_OBJ(objOutlook,'CreateItem',objarg);
OLE2.DESTROY_ARGLIST(objarg);
OLE2.SET_PROPERTY(objmail,'To',:TO);
OLE2.SET_PROPERTY(objmail,'Subject',:SUBJECT);
OLE2.SET_PROPERTY(objmail,'Body',:BODY);
OLE2.INVOKE(objmail,'Send');
OLE2.INVOKE(objmail,'Display');
OLE2.RELEASE_OBJ(objmail);
OLE2.RELEASE_OBJ(objOutlook);
Message('Your mail sent successfully..............');
Message('Your mail sent successfully..............');
END;
by and enjoy
[Updated on: Fri, 17 February 2012 14:32] Report message to a moderator
|
|
|
|
|
|
|
|
Re: how can i send sms and mail through form 6i [message #544139 is a reply to message #544050] |
Mon, 20 February 2012 05:38 |
|
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
reagrding sending mail by using form 10g
CREATE OR REPLACE FUNCTION SEND_MAIL
(pIssuer IN VARCHAR2,
pReceiver IN VARCHAR2,
pSender IN VARCHAR2,
pSubject IN VARCHAR2,
pMessage IN VARCHAR2) RETURN VARCHAR2 IS
c utl_smtp.connection;
respuesta utl_smtp.reply;
pServer VARCHAR2(50) := 'SERVER';
BEGIN
c := utl_smtp.open_connection(pServer);
respuesta := utl_smtp.helo(c, pServer);
respuesta := utl_smtp.mail(c, pSender);
respuesta := utl_smtp.rcpt(c, pReceiver);
respuesta := utl_smtp.open_data(c);
utl_smtp.write_data(c, 'From: ' || pIssuer || utl_tcp.CRLF);
utl_smtp.write_data(c, 'To: ' || pReceiver || utl_tcp.CRLF);
utl_smtp.write_data(c, 'Subject: ' || pSubject || utl_tcp.CRLF);
utl_smtp.write_data(c, utl_tcp.CRLF || pMessage);
utl_smtp.write_data(c, utl_tcp.CRLF || '.');
respuesta := utl_smtp.close_data(c);
respuesta := utl_smtp.quit(c);
RETURN '0';
EXCEPTION
WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
utl_smtp.quit(c);
RETURN sqlerrm;
error: ' || sqlerrm);
WHEN OTHERS THEN
RETURN sqlerrm;
END;
/
hope it will help u
[Updated on: Mon, 20 February 2012 05:50] Report message to a moderator
|
|
|
|
Re: how can i send sms and mail through form 6i [message #544160 is a reply to message #544139] |
Mon, 20 February 2012 06:34 |
|
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
Before doing all these things first u have to learn hgow to do this read this as below.
How to send email from 10g Oracle Database (UTL_MAIL)
10g, email, mail, mailx, sendmail, utl_mail |
Heres a simple solution to send out emails from 10g Database sql prompt.
This solution will be really helpful if the OS utility (mailx, sendmail) is restricted for end users.
Steps to enable Mailing from Database
1. sqlplus '/ as sysdba'
2. @$ORACLE_HOME/rdbms/admin/utlmail.sql
3. @$ORACLE_HOME/rdbms/admin/prvtmail.plb
4. Set smtp_server information in init.ora or spfile.ora
alter system set smtp_out_server = 'SMTP_SERVER_IP_ADDRESS:SMTP_PORT' scope=both;
25 = Default SMTP Port
If instance had been started with spfile
eg: alter system set smtp_out_server = '172.25.90.165:25′ scope=both;
If instance had been started with pfile
alter system set smtp_out_server = '172.25.90.165:25′;
Also make below entry in your initSID.ora
smtp_out_server = '172.25.90.165:25′
Thats It, your database is configured to send emails ....
How to send an email
1. sqlplus '/ as sysdba'
2. exec utl_mail.send((sender => 'oraclepitstop@wordpress.com', recipients => 'oraclepitstop@wordpress.com', subject => 'Testing UTL_MAIL Option', message => 'blah blah blah');
3. Check the inbox of the email id, to verify the email receipt.
To enable other DB users to use this functionality, grant execute permission on UTL_MAIL package.
eg: grant execute on utl_mail to apps;
------------Simple Example---------------------------
/*UTL_MAIL
The UTL_MAIL package provides a simple API to allow email to be sent from PL/SQL. In prior versions this was possible using the UTL_SMTP package (shown here), but this required knowledge of the SMTP protocol.*/
The package is loaded by running the following scripts.
CONN sys/password AS SYSDBA
ALTER SYSTEM SET smtp_out_server='smtp.domain.com' SCOPE=SPFILE;
SHUTDOWN IMMEDIATE
STARTUP
With the configuration complete we can now send a mail.
BEGIN
UTL_MAIL.send(sender => 'me@domain.com',
recipients => 'person1@domain.com,person2@domain.com',
cc => 'person3@domain.com',
bcc => 'myboss@domain.com',
subject => 'UTL_MAIL Test',
message => 'If you get this message it worked!');
END;
/
Despite this if could not understand to do thn tell me i will send you a .FMB file send mail by using Form 10g
Happy Mailing !!!
cheers,
[Updated on: Mon, 20 February 2012 06:53] Report message to a moderator
|
|
|
|
|
|
|
|