|
|
|
|
|
|
Re: How to send sms to mobile device using oracle form 6i [message #598957 is a reply to message #598934] |
Sun, 20 October 2013 23:04 |
|
dark_prince
Messages: 121 Registered: June 2013 Location: India
|
Senior Member |
|
|
Hii, I tried to send sms from sms caster software its working but when i try to send from command prompt it giving me error like it not recognized as external, internal command. And I want to know is it possible to send sms without using phone like just create procedure and called that procedure to send sms.
I found to link
http://http://www.inside-oracle-apex.com/sending-sms-to-mobile-phone/
In this this procedure is givrn
CREATE OR REPLACE PROCEDURE sendSMS
( pRecipient IN VARCHAR2
, pBody IN VARCHAR2
)
IS
ESENDEX_USERNAME CONSTANT VARCHAR2(40) := 'your_username';
ESENDEX_PASSWORD CONSTANT VARCHAR2(40) := 'your_password';
ESENDEX_ACCOUNT CONSTANT VARCHAR2(40) := 'your_account';
--
vRequest Utl_Http.req;
vPostText VARCHAR2(500);
vResponse Utl_Http.resp;
vResponseText VARCHAR2(2000);
vErrorText VARCHAR2(200);
BEGIN
----------------------------------------------------------------------------
-- Build text for the post action.
-- For a field description, see
-- http://www.esendex.com/secure/messenger/formpost/SendSMS.aspx
----------------------------------------------------------------------------
vPostText :=
'EsendexPlainText=YES' ||CHR(38)||
'EsendexUsername=' ||Utl_Url.escape(ESENDEX_USERNAME, TRUE)||CHR(38)||
'EsendexPassword=' ||Utl_Url.escape(ESENDEX_PASSWORD, TRUE)||CHR(38)||
'EsendexAccount=' ||Utl_Url.escape(ESENDEX_ACCOUNT, TRUE)||CHR(38)||
'EsendexRecipient='||Utl_Url.escape(pRecipient, TRUE)||CHR(38)||
'EsendexBody=' ||Utl_Url.escape(pBody, TRUE);
----------------------------------------------------------------------------
-- if you need to set a proxy, uncomment next line.
----------------------------------------------------------------------------
/* Utl_Http.set_proxy('proxy.it.my-company.com', 'my-company.com'); */
----------------------------------------------------------------------------
-- Send SMS through the Esendex SMS service.
----------------------------------------------------------------------------
vRequest := Utl_Http.begin_request
( url => 'http://www.esendex.com/secure/messenger/formpost/SendSMS.aspx'
, method => 'POST'
);
Utl_Http.set_header
( r => vRequest
, name => 'Content-Type'
, value => 'application/x-www-form-urlencoded'
);
Utl_Http.set_header
( r => vRequest
, name => 'Content-Length'
, value => LENGTH(vPostText)
);
Utl_Http.write_text
( r => vRequest
, data => vPostText
);
vResponse := Utl_Http.get_response(vRequest);
IF vResponse.status_code = '200'
THEN
Utl_Http.read_text(vResponse, vResponseText);
--
IF vResponseText NOT LIKE 'Result=OK%'
THEN
vErrorText := vResponseText;
END IF;
ELSE
vErrorText := 'HTTP status: '||vResponse.status_code||'-'||vResponse.reason_phrase;
END IF;
--
Utl_Http.end_response(vResponse);
--
IF vErrorText IS NOT NULL
THEN
RAISE_APPLICATION_ERROR(-20001, 'Sending SMS failed with '||vErrorText);
END IF;
END sendSMS;
But when i try to compile to this procedure it gives me error -- PLS-00320: the declaration of type of this expression is incomplete or malformed.
BEGIN
sendSMS('+436991812345','this is a test');
END;
Can you tell how to solve this problem
|
|
|
|
Re: How to send sms to mobile device using oracle form 6i [message #598981 is a reply to message #598976] |
Mon, 21 October 2013 03:58 |
|
mughals_king
Messages: 392 Registered: January 2012 Location: pakistan
|
Senior Member |
|
|
have you set your imcomming and outgoing mail service have taken setting from your internet service provider
incoming mail(POP3, IMAP or HTTP Server)
outgoing mail(SMTP server)
like this way
conn / as sysdba
ALTER SYSTEM SET smtp_out_server = 'smtp.mobilink.com' SCOPE=BOTH;
your try is good you have to set smtp_out_Server
Regard
Mughal
|
|
|