Check SMTP Server Availability for ORA-29278 or ORA-29279 errors using UTL_SMTP to Send Email
| Check SMTP Server Availability for ORA-29278 or ORA-29279 errors using UTL_SMTP to Send Email. (文档 ID 604763.1) | 转到底部 | ![]() |
修改时间:2014-5-13 类型:PROBLEM![]() |
|

|
In this Document
APPLIES TO:PL/SQL - Version 9.2.0.8 and later SYMPTOMSWhen trying to send email using UTL_SMTP getting following error : ORA-29278: SMTP transient error: 421 Service not available
ORA-06512: at "SYS.UTL_SMTP", line 21 ORA-06512: at "SYS.UTL_SMTP", line 97 ORA-06512: at "SYS.UTL_SMTP", line 139 Or potentially ORA-29279: SMTP permanent error
followed by a SMTP error code. CAUSEThe "ORA-29278: SMTP transient error: 421 Service not available" error indicates that the problem is not with the UTL_SMTP package SOLUTIONYou first have to check whether you are able to contact the email server without involving ORACLE. For example use the following telnet procedure to see whether the mail server is reachable from the Database server: ******PERFORM THE FOLLOWING OPERATIONS FROM YOUR DATABASE SERVER MACHINE AND NOT FROM OTHER MACHINES.****** Note: The information presented here does not apply to TLS/SSL connections . a) Start a telnet session to the SMTP server's communication port. (The default port for SMTP is 25)
$telnet <smtp servername as used utl_smtp package> 25 A telnet session should open with a response from smtp: For eg : response from smtp ---> 220 ukxxx1 Sendmail SMI-8.6/SMI-SVR4 ready at b) Now introduce the client machine to the server by typing: c) Tell the SMTP Gateway who the test email is coming from by typing: For eg : A response from smtp ---> 250 emailid@domain... Sender ok d) Tell the SMTP Gateway who to send the test email to by typing: For eg : A response from smtp ---> 250 emailid@domain... Recipient ok e) Tell the SMTP Gateway what type of information is being sent by typing: A response from smtp ---> 354 Enter mail, end with "." on a line by itself f) Enter the test message and remember to close the email with a dot "." A response from smtp ---> 250 PAA15913 Message accepted for delivery g) End the SMTP connection session by typing: response from smtp ---> 221 ukxxx1 closing connection The email should then be delivered to the receiver via the SMTP server. If the command line test doesn't work, hopefully a helpful error messages from the SMTP server will be displayed indicating a problem will be with the SMTP server setup. If the above telnet session fails it confirms the network block . You may have to contact your network administrator to remove the block. If the telnet session succeeds, then try the following sample code to test the smtp server : Note : Please change the smtp server name in line number 6 and 7 in procedure TESTMAIL. Note: If the below code fails again with the same error , then use IP Address instead of Mail server name in line number 6 and 7.
OR Make the hostname entry in the /etc/hosts file so that it is properly resolved to an IP address CREATE OR REPLACE PROCEDURE TESTMAIL(fromm VARCHAR2,too VARCHAR2,sub VARCHAR2,body VARCHAR2,port NUMBER)
IS objConnection UTL_SMTP.CONNECTION; vrData VARCHAR2(32000); BEGIN objConnection := UTL_SMTP.OPEN_CONNECTION('<user smtp server name or ip address>',PORT); UTL_SMTP.HELO(objConnection, '<user smtp server name or ip address>'); UTL_SMTP.MAIL(objConnection, fromm); UTL_SMTP.RCPT(objConnection, too); UTL_SMTP.OPEN_DATA(objConnection); UTL_SMTP.WRITE_DATA(objConnection, 'From: '||fromm || UTL_TCP.CRLF); UTL_SMTP.WRITE_DATA(objConnection, 'Subject: ' || sub || UTL_tcp.CRLF); UTL_SMTP.WRITE_DATA(objConnection, 'Content-Transfer-Encoding: ' || '"8Bit"' || UTL_TCP.CRLF); DECLARE
Vdate Varchar2(25); BEGIN Vdate := to_char(sysdate,'dd-mon-yyyy HH:MI:SS AM'); TESTMAIL('xxx.xxx@xxx.com', 'xxx.xxx@xxx.com', 'TESTMAIL','This is a UTL_SMTP-generated email at '|| Vdate,25); END; / Collaborate with and learn from your Peers, Industry Experts and Oracle Support Product Specialists using My Oracle Support Community. Join us here: Oracle Community - https://communities.oracle.com/ Oracle PL/SQL Community - https://community.oracle.com/community/support/oracle_database/pl_sql REFERENCESNOTE:74269.1 - How to Test an SMTP Mail Gateway From a Command Line Interface |
Check SMTP Server Availability for ORA-29278 or ORA-29279 errors using UTL_SMTP to Send Email的更多相关文章
- SSRS1:配置SMTP Server发送mail
为了使用SSRS发送mail,必须为Reporting service配置SMTP Server. 1,在Reporting Service Configuration Manager中配置Email ...
- Spring – Sending E-Mail Via Gmail SMTP Server With MailSender--reference
Spring comes with a useful ‘org.springframework.mail.javamail.JavaMailSenderImpl‘ class to simplify ...
- 安装VisualSVN Server 报"Service 'VisualSVN Server' failed to start. Please check VisualSVN Server log in Event Viewer for more details"错误.原因是启动"VisualSVN Server"失败
安装VisualSVN Server 报"Service 'VisualSVN Server' failed to start. Please check VisualSVN Server ...
- 关于安装SVN Service 出错 Service 'VisualSVN Server' failed to start. Please check VisualSVN Server log in Event Viewer for more details
关于安装SVN Service 出错 Service 'VisualSVN Server' failed to start. Please check VisualSVN Server log in ...
- kibana加访问控制时报错--Kibana did not load properly.Check the server output for more information.
错误 在使用kibana的时候,我们需要对可以进行日志访问进行控制,x-pack插件是最好的选择,但是kibana的x-pack插件是收费的,我们本着节约资源的理念(公司的钱也是钱啊,哈哈),我决定使 ...
- oracle中的listener.ora和tnsnames.ora
一.oracle的客户端与服务器端 oracle在安装完成后服务器和客户端都需要进行网络配置才能实现网络连接. 服务器端配置监听器,客户端配置网络服务名. 服务器端可配置一个或多个监听程序 . ...
- 记录一份Oracle 正确的监听配置文件listener.ora与tnsnames.ora
一.前言 昨天中午接到领导指示,有其他组的负责人B在厄瓜多尔演示他们组的产品,然后我们组的负责人就想说也在那边搭一套环境,(北美那边的亚马逊云环境),让B帮忙演示下我们的系统. 于是,开始了一个比较曲 ...
- PLSQL连接ORACLE配置字符串简介 oracle网络配置 三个配置文件 listener.ora、sqlnet.ora、tnsnames.ora原理解释
PLSQL连接ORACLE配置字符串简介 oracle网络配置 三个配置文件 listener.ora.sqlnet.ora.tnsnames.ora原理解释 oracle网络配置三个配置文件 lis ...
- oracle: listener.ora 、sqlnet.ora 、tnsnames.ora的配置及例子
1.解决问题:TNS或者数据库不能登录. 最简单有效方法:使用oracle系统提供的工具 netca 配置(把原来的删除掉重新配置) $netca 2.然而,仍有疑问:如何指定'l ...
随机推荐
- EF框架+Lamada表达式(联合多表lamada表达式的用法)
有俩张表对应的EF框架的类Reviews和Commodity_Review,新建一个新的类,字段是联合俩张表后自己需要展示的字段ReviewsShow IQueryable<ReviewsSho ...
- spring mvc <mvc:annotation-driven>配置使用出现故障
我在使用converter进行全局的日期类型转换. 1.写converer public class CustomDateConverter implements Converter<Strin ...
- Android UI 使用HTML布局(直接打开server网页)
非常多时候我们用HTML布局会更方便直接,记录一下. 我如今主要是直接调用server的网页(实际上是jsp的,仅仅是返回的是html).所以须要联网,第一步加入权限. <uses-permis ...
- stage.width/height和stage.stageWidth/stageHeight的区别
stage.stageWidth和stage.stageHeight就是舞台的宽带和高度 一般默认打开宽带是550,高度是400 那么stage.stageWidth=550,stage.stageH ...
- 【27前端】字体图标 Font Face
设计师做的高保真原型图,难免会用到艺术字体. 采用切片的方式,简单,粗暴,节省时间.除了retina屏其它兼容性也是一流.但是在修改的时候,会花很大的力气.即使只是修改文字大小,也需要重新切图,更别说 ...
- Android中view的事件
view:top.left.right.bottom,相对于parent的位置参数,获取通过get*()来获取.width=right-left.height=bottom-top.x=left+tr ...
- 13个mysql数据库的实用SQL小技巧
此文章为转载 使用CASE来重新定义数值类型 SELECT id,title, (CASE date WHEN '0000-00-00' THEN '' ELSE date END) AS date ...
- juce中的内存泄漏检测
非常值得借鉴的做法,基于引用计数和局部静态变量,代码比较简单不加详解. //============================================================== ...
- [ZT]图像处理库的比较:OpenCV,FreeImage,CImg,CxImage
1.对OpenCV 的印象:功能十分的强大,而且支持目前先进的图像处理技术,体系十分完善,操作手册很详细,手册首先给大家补计算机视觉的知识,几乎涵盖了近10年内的主流算法: 然后将图像格式和矩阵运算, ...
- mysql表结构设计
允许NULL值的字段,数据库在进行比较操作时,会先判断其是否为NULL,非NULL时才进行值的必对.因此基于效率的考虑,所有字段均不能为空,即全部NOT NULL: 对于变长表,由于记录大小不同,在其 ...
