472,106 Members | 1,380 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,106 software developers and data experts.

How Fast is ULT_SMTP

151 100+
HI all

I ahve used utl_smtp package many a times. But how can we determine its speed.

I mean suppose if i call this from my code inside a package, how can we determine the speed it sends a mail.

--> Can i send mail to a gmail account
--> in utl_smtp.conection , what are two parameters. How can i use these params in my local system.

Dec 17 '08 #1
14 7081
8,127 Expert 4TB
1.speed of sending mail depends on size nand type of mail and size of attchemnt if any.
2.you can send mail to any mail account.
3.utl_smtp.connection does not accept any parameters but utl_smtp.open_connection does, the parametrs are mailhost and port number for SMTP (usually 25) This is the default value .

so you can work with only one parameter that is hostname.
Jan 2 '09 #2
151 100+
Thanks a lot.

Now i want to write a package, which i will be calling from a Oracle Form. The form has a text box that is used to enter the email address. As soon as user clicks on submit button. the mail should be triggered to the captured email id. How to do that?

Irrespective of the mail id,(assumin all the mail ids are from Gmail only) can we send the mail.

Jan 5 '09 #3
2,367 Expert 2GB
Yes you can always do that.. In forms builder, on button click, wirte a code to send a mail and you will need to read the to address from a text box and store that in a variable.
Jan 5 '09 #4
151 100+
thanks a lot

but my question was different. I am done with the code at th forms side. But in my package ehile using utl_smtp package, how can i dynamically selct the host.

suppose the user enters a ymail, then will the host for utl_smtp change. How can we determine the host if the mail id is always changing
Jan 5 '09 #5
8,127 Expert 4TB
HOST NAME refers to the host of the sending mail server not the target mail server address.
Jan 5 '09 #6
2,367 Expert 2GB
And the Host name used in utl_smtp does not change.it remains the same since it is the host name of source smtp server and not the destination server as mentioned by Debasis
Jan 6 '09 #7
151 100+
I got the followinr error when trying to send mail

Expand|Select|Wrap|Line Numbers
  2. ERROR at line 1:
  3. ORA-29278: SMTP transient error: 421 Service not available
  4. ORA-06512: at "SYS.UTL_SMTP", line 17
  5. ORA-06512: at "SYS.UTL_SMTP", line 96
  6. ORA-06512: at "SYS.UTL_SMTP", line 138
  7. ORA-06512: at "SCOTT.SEND_MAIL", line 11
  8. ORA-06512: at line 1
and this is my code:
Expand|Select|Wrap|Line Numbers
  2. create or replace procedure send_mail
  3. is
  4. conn utl_smtp.connection;
  5. host varchar2(100) := '';
  6. send varchar2(200);
  7. msg varchar2(100);
  9. begin
  10. Select ename into msg from emp where empno = 7369;
  11. send :='mailtovamsidhar.p@gmail.com';
  12. conn:= utl_smtp.open_connection( 'host');
  13. utl_smtp.helo( conn, 'host');
  14. utl_smtp.mail( conn,send);
  15. utl_smtp.rcpt( conn, send);
  17. utl_smtp.data( conn,msg);
  18. utl_smtp.quit( conn );
  19. end send_mail;
Jan 10 '09 #8
308 256MB

Check whether the SMTP service is Up/running on the Oracle database server you are using.

Jan 12 '09 #9
2,367 Expert 2GB
Try this code:
Expand|Select|Wrap|Line Numbers
  1. create or replace procedure send_mail
  2. is
  3. conn utl_smtp.connection;
  4. host varchar2(100) := '';
  5. send varchar2(200);
  6. msg varchar2(100);
  8. begin
  9. Select ename into msg from emp where empno = 7369;
  10. send :='mailtovamsidhar.p@gmail.com';
  11. conn:= utl_smtp.open_connection( host,25);
  12. utl_smtp.helo( conn, host);
  13. utl_smtp.mail( conn,send);
  14. utl_smtp.rcpt( conn, send);
  16. utl_smtp.data( conn,msg);
  17. utl_smtp.quit( conn );
  18. end send_mail; 
Jan 12 '09 #10
151 100+
This was the error i got.

I made the IIS changes in control panel.

ERROR at line 1:
ORA-29279: SMTP permanent error: 550 5.7.1 Unable to relay for mailtovamsidhar.p@gmail.com
ORA-06512: at "SYS.UTL_SMTP", line 17
ORA-06512: at "SYS.UTL_SMTP", line 98
ORA-06512: at "SYS.UTL_SMTP", line 240
ORA-06512: at "SCOTT.MAIL", line 14
ORA-06512: at line 1

what is relaying the mail id

Jan 12 '09 #11
2,367 Expert 2GB
Your From Address should be related to your source SMTP server. For eg: if our server alias is acne.com then from addr will be 'abcd@acne.com'. So change your From address in the line UTL_SMTP.MAIL with the propoer from address
Jan 13 '09 #12
151 100+
The package is executing perfectly but still i get the same error. I checked the IIS in the control panel and everything is fine. Still i get the same error. Is there any other reason to get this other than IIS-->SMTP enabling

ERROR at line 1:
ORA-29278: SMTP transient error: 421 Service not available
ORA-06512: at "SYS.UTL_SMTP", line 17
ORA-06512: at "SYS.UTL_SMTP", line 96
ORA-06512: at "SYS.UTL_SMTP", line 138
ORA-06512: at "SCOTT.SEND_MAIL", line 11
ORA-06512: at line 1
Jan 14 '09 #13
2,367 Expert 2GB
The error itself is self explanatory. "Service Not Available". Do you have any other Unix Server or SMTP server that you can use for testing. Either your SMTP Server is Down or Incorrect.
Jan 15 '09 #14
151 100+
I am trying this on my laptop, running Windows Xp SP2. So is there a solution for this ?
Jan 15 '09 #15

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

18 posts views Thread by Michele Simionato | last post: by
reply views Thread by Dean J Garrett | last post: by
8 posts views Thread by Neil | last post: by
6 posts views Thread by G.Esmeijer | last post: by
10 posts views Thread by javuchi | last post: by
95 posts views Thread by hstagni | last post: by
9 posts views Thread by Salad | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.