Home » Developer & Programmer » Forms » MAIL
icon8.gif  MAIL [message #128903] Thu, 21 July 2005 02:48 Go to next message
sQeKy
Messages: 24
Registered: July 2005
Junior Member
Sigh .. i did not find any java beans and my boss does not want to use outlook for sending mails ....
ok now i think the utl_smpt ... is the last resort ....
I have found a couple of snippets over the net but they dont seem to work :S
I need help .. please give a full procedure or site where the full procedure is given :/
thanks
Re: MAIL [message #128905 is a reply to message #128903] Thu, 21 July 2005 02:58 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Search this forum for 'utl_smtp' and 'utl_mail'. A recent posting has the links.

David

utl_smtp, not utl_smpt

[Updated on: Thu, 21 July 2005 02:59]

Report message to a moderator

Re: MAIL [message #128914 is a reply to message #128905] Thu, 21 July 2005 03:59 Go to previous messageGo to next message
sQeKy
Messages: 24
Registered: July 2005
Junior Member
okay i found this snippet some where ...


PROCEDURE SimpleTextMessage IS
mailHOST VARCHAR2(64) := 'mail@softech.com';
mailFROM VARCHAR2(64);
mailTO VARCHAR2(64);
mailCONN utl_smtp.connection;
mailDATE VARCHAR2(20);
vreply utl_smtp.reply;
vreplies utl_smtp.replies;
i number;

BEGIN
mailFROM := 'ibraheem@softech.com';
mailTO := 'squekylilbrat@gmail.com';
SELECT TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS') INTO mailDATE FROM dual;

dbms_output.put_line('open_connection');
dbms_output.put_line('---------------');
vreply := utl_smtp.open_connection(mailHOST, 25, mailCONN);
dbms_output.put_line( 'code = ' || vreply.code );
dbms_output.put_line( 'text = ' || vreply.text );

dbms_output.put_line('help');
dbms_output.put_line('----');
vreplies := utl_smtp.help(mailCONN, 'HELP');
for i in 1..vreplies.count loop
dbms_output.put_line( 'code = ' || vreplies(i).code );
dbms_output.put_line( 'text = ' || vreplies(i).text );
end loop;

dbms_output.put_line('ehlo');
dbms_output.put_line('----');
vreplies := utl_smtp.ehlo(mailCONN, mailHOST);
for i in 1..vreplies.count loop
dbms_output.put_line( 'code = ' || vreplies(i).code );
dbms_output.put_line( 'text = ' || vreplies(i).text );
end loop;

--dbms_output.put_line('helo');
--dbms_output.put_line('----');
--vreply := utl_smtp.helo(mailCONN, mailHOST);
--dbms_output.put_line( 'code = ' || vreply.code );
--dbms_output.put_line( 'text = ' || vreply.text );

dbms_output.put_line('mail');
dbms_output.put_line('----');
vreply := utl_smtp.mail(mailCONN, mailFROM);
dbms_output.put_line( 'code = ' || vreply.code );
dbms_output.put_line( 'text = ' || vreply.text );

dbms_output.put_line('rcpt');
dbms_output.put_line('----');
vreply := utl_smtp.rcpt(mailCONN, mailTO);
dbms_output.put_line( 'code = ' || vreply.code );
dbms_output.put_line( 'text = ' || vreply.text );

dbms_output.put_line('open_data');
dbms_output.put_line('---------');
vreply := utl_smtp.open_data(mailCONN);
dbms_output.put_line( 'code = ' || vreply.code );
dbms_output.put_line( 'text = ' || vreply.text );

utl_smtp.write_data(mailCONN, 'Subject: '|| 'A subject' || chr(13));
utl_smtp.write_data(mailCONN, 'From: '||mailFROM || chr(13));
utl_smtp.write_data(mailCONN, 'Date: '||mailDATE || chr(13));
utl_smtp.write_data(mailCONN, 'To: '||mailTO || chr(13));
utl_smtp.write_data(mailCONN, 'CC: '||mailFROM || chr(13));
utl_smtp.write_data(mailCONN, 'BCC: '||mailFROM || chr(13));
utl_smtp.write_data(mailCONN, chr(13));
utl_smtp.write_data(mailCONN, 'Hello Friend.' || chr(13));
utl_smtp.write_data(mailCONN, 'Drop me an e-mail.' || chr(13));

dbms_output.put_line('close_data');
dbms_output.put_line('----------');
vreply := utl_smtp.close_data(mailCONN);
dbms_output.put_line( 'code = ' || vreply.code );
dbms_output.put_line( 'text = ' || vreply.text );

dbms_output.put_line('quit');
dbms_output.put_line('----');
vreply := utl_smtp.quit(mailCONN);
dbms_output.put_line( 'code = ' || vreply.code );
dbms_output.put_line( 'text = ' || vreply.text );
END;


i have put this procedure in my program units .. i created a button and called SimpleTextMessage();

Can any one tell me if its bound to work or not .. coz its not working ... are there any problems with this ... or what :/
Re: MAIL [message #129173 is a reply to message #128914] Fri, 22 July 2005 05:35 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Wow, you must have searched very very hard.

I've googled for 'javabean send mail' and it popped up with:
Advanced JSP Sample : Sending Email. The first result came right of the Oracle site.


Or am I missing something: it's a Javabean for sending emails.

MHE
Re: MAIL [message #129394 is a reply to message #129173] Mon, 25 July 2005 01:03 Go to previous messageGo to next message
sQeKy
Messages: 24
Registered: July 2005
Junior Member
OK that is JSP ... using java mail api
i need oracle forms using java mail api!!!
Re: MAIL [message #129443 is a reply to message #129394] Mon, 25 July 2005 05:09 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
Well, with the link provided you have a base to start from:
Forms can use JavaBeans (program -> import Java classes...). Call it in a trigger and you can start debugging.

Assuming you have tested the above solution and it didn't work. Then I can direct you to MetaLink where I've found a forum thread entitled ""How to send email WITH ATTACHEMENT(S)". The doc id is 238382.999.

Look at that one. It seems pretty interesting. I didn't test it myself though...our mail package is on the server.

Oh, and one more thing: Your procedure "simpletextmessage" seems fine, but the variable mailHOST seems somewhat awkward. Isn't your smtp server "smtp.softech.com" or something. I've ran it here against our smtp server and got an email within 2 seconds...


MHE
Re: MAIL [message #508103 is a reply to message #129443] Thu, 19 May 2011 08:05 Go to previous message
randriana
Messages: 18
Registered: September 2010
Junior Member
I have the same problem but mine is :

1- I have a table that lists a multiple person with their email
2- I have a .xls files that a must send with them every month

Any one can help me to do this with oracle forms 10g interface and save the date of sending and the operator who sent it? As like a cursor or another thing...
Previous Topic: Display multiple forms at runtime
Next Topic: Oracle Developer Suite Run time Settings
Goto Forum:
  


Current Time: Sat Sep 07 15:33:12 CDT 2024