Home » Developer & Programmer » Forms » how can i send sms and mail through form 6i [merged 2 by JD] (d2k 6i, win 2000)
how can i send sms and mail through form 6i [merged 2 by JD] [message #543932] Fri, 17 February 2012 13:47 Go to next message
kundanmca12
Messages: 3
Registered: September 2008
Location: Mumbai
Junior Member

any one tell me how can i send sms and mail through d2k 6i form?plz its urgent and reply me-kundanmca12@gmail.com
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 Go to previous messageGo to next message
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 Smile






[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 #543934 is a reply to message #543933] Fri, 17 February 2012 15:16 Go to previous messageGo to next message
mughals_king
Messages: 392
Registered: January 2012
Location: pakistan
Senior Member
dear those above texts field which i mentioned no need to create any table simply change in property 'Data Type'=CHAR That's enough



Thanks


Re: how can i send sms and mail through form 6i [message #543940 is a reply to message #543933] Sat, 18 February 2012 00:24 Go to previous messageGo to next message
kundanmca12
Messages: 3
Registered: September 2008
Location: Mumbai
Junior Member

i am facing some problem during the sending mail so please help me
Re: how can i send sms and mail through form 6i [message #543941 is a reply to message #543940] Sat, 18 February 2012 00:55 Go to previous messageGo to next message
Littlefoot
Messages: 21813
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Hold on, I'm concentrating ...

<3 minutes later>

Can you send mail now? I believe you should, as I was sending my best thoughts ("Make it work! Make it work") towards your computer.
Re: how can i send sms and mail through form 6i [message #543967 is a reply to message #543940] Sat, 18 February 2012 08:48 Go to previous messageGo to next message
mughals_king
Messages: 392
Registered: January 2012
Location: pakistan
Senior Member
what kind of problem you are facing what else should we tell u its quite easy to use and already tested thousands of time mail successfully sending have u configure your outlook express proper


Re: how can i send sms and mail through form 6i [message #544050 is a reply to message #543967] Sun, 19 February 2012 11:18 Go to previous messageGo to next message
baliberde
Messages: 201
Registered: January 2012
Location: outer space
Senior Member
hi may i ask if this still works in 10g?
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 Go to previous messageGo to next message
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

how can i send SMS through oracle 10g - Forms/report(6i) [message #544153 is a reply to message #543932] Mon, 20 February 2012 06:21 Go to previous messageGo to next message
kundanmca12
Messages: 3
Registered: September 2008
Location: Mumbai
Junior Member

Hi,

Currently we are using "oracle 10g - Forms/report(6i)".I want some help and Idea about how to send SMS on mobile by using the above database & application or any other application by using the above oracle database.


kundan kumar
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 Go to previous messageGo to next message
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

Re: how can i send SMS through oracle 10g - Forms/report(6i) [message #544783 is a reply to message #544153] Thu, 23 February 2012 15:03 Go to previous messageGo to next message
mughals_king
Messages: 392
Registered: January 2012
Location: pakistan
Senior Member
For kundanmca12

Hello All!
There is a Way to send Message From Oracle Database Server to
Mobile Device.One Way is to Send Email using Oracle SMTP Package - [UTL_SMTP].
Mostly Cellular Service Providers give the Facility to their users to Recieve Email on Post-Paid Connections.{Mobile_No@Service_Provider_Domain.com} is the E-Mail Address for Post-Paid Connection Holder.e.g.

+923022912307@mobilinkgsm.com.

In this Way, Install/Configure Oracle Database 8.x/9.x/10.x and

Create a [url]Package.http://www.oracle.com/[/url]
                 technology/sample_code/
                 tech/pl_sql/htdocs/
                 maildemo_sql.txt
BEGIN 
demo_mail.mail(sender =>
                 'Me <[email]me@some-company.com[/email]>',
                  recipients => 'Someone<Mobile_No@
                  Celluler_Service_Provider_Domain.com>',
                  subject=> 'SMS From Oracle Database Server',
                  message    => 'Hi! This is a test Message.');
END;
/

Second Way is to Send SMS Using GSM Modem/Mobile Phone & its Supporting Software/Utility.There are many
software/utilities/Tools which can do this, but here i am using a free project.In this Way, Install/Configure:* Red Hat Linux Operating System * Oracle Database 8i/9.x/10.x* gnokii - For Nokia Mobile PhoneDownload:http://gnokii.org/download/gnokii/0.6.x/gnokii-0.6.2.tar.gzInstall : http://urtica.linuxnews.pl/~pkot/gnokii/gnokii.html#ch1
SampleFile:

http://cvs.savannah.nongnu.org/viewcvs
/gnokii/gnokii/Docs/sample/gnokiirc?rev=1.22User
Guide:

http://wiki.gnokii.org/index.php/User%27s_Guide* Nokia Mobile

Phone With Data Cable - http://www.gnokii.org/cables.shtml Try to Send SMS Using the Command.Anzish$ echo "This is a test SMS using gnokii-Linux..." | gnokii --sendsms +923022912307
Note : Message Length = 160 Characters.It Will Take 30 - 40 Seconds and will send the SMS to the desired Number.To Test &
Configure it in Oracle Database, you have to Create a Java
Class.http://www.oracle-

base.com/articles/8i/ShellCommands From PLSQL.phpSET

SERVEROUTPUT ON SIZE 1000000
       CALL DBMS_JAVA.SET_OUTPUT(1000000);
BEGIN
       Host_Command (p_command => 'echo "
       This is a test SMS from Oracle Database."| gnokii
       -- sendsms +923022912307');
END;
/


I have tried it on Nokia Several model such as 6030 and its Working. Fine


Enjoy

[Updated on: Thu, 23 February 2012 15:07]

Report message to a moderator

Re: how can i send sms and mail through form 6i [message #545980 is a reply to message #543933] Sun, 04 March 2012 04:59 Go to previous messageGo to next message
ashussain
Messages: 35
Registered: March 2011
Location: Saudi Arabia
Member

Hi

I tried to send a mail but, its sending only to outlook. What if I want to send mail on Gmail or Yahoo mail ids.
Re: how can i send sms and mail through form 6i [message #546049 is a reply to message #544160] Mon, 05 March 2012 00:43 Go to previous messageGo to next message
ashussain
Messages: 35
Registered: March 2011
Location: Saudi Arabia
Member

" Despite this if could not understand to do thn tell me i will send you a .FMB file send mail by using Form 10g..."

Could you please send the .FMB file to do the same?

Thanks in advance...
Re: how can i send sms and mail through form 6i [message #546051 is a reply to message #543933] Mon, 05 March 2012 00:51 Go to previous messageGo to next message
ashussain
Messages: 35
Registered: March 2011
Location: Saudi Arabia
Member

Hello Sir,

I'm sorry sterday, using the code given by you, I was unable to send mail to other ids like gmail or yahoo. but today I checked it, its working fine to send mail to either gmail id or yahoo id etc.,

Thanks a lot
Re: how can i send sms and mail through form 6i [message #546097 is a reply to message #546051] Mon, 05 March 2012 05:45 Go to previous message
mughals_king
Messages: 392
Registered: January 2012
Location: pakistan
Senior Member
just have seen your post after great sunday Cool i was wondwer after reading your post Shocked u were unable to send email to other email like yahoo,gmail etc finally u got it its good & feel free for further queries we r all here colleagus for helping each others



Best Regards

[Updated on: Mon, 05 March 2012 05:46]

Report message to a moderator

Previous Topic: MASTER-DETAIL FORM
Next Topic: Why the "Arabic comma" reverse the text.(4 Merged)
Goto Forum:
  


Current Time: Fri Jul 05 23:25:06 CDT 2024