Oracle PL/SQL UTL_SMTP 引发 501 5.1.7 发件人地址语法错误
当我使用 UTL_SMTP 包发送电子邮件时,在执行命令 UTL_SMTP.MAIL 时收到此错误:
501 5.1.7 Bad sender address syntax
我将电子邮件作为第二个参数传递。这种情况仅发生在某些 smtp 服务器上。 代码是这样的:
sFrom := '[email protected]';
Utl_Smtp.Mail(Connection, sFrom);
有谁知道如何解决这个问题?
提前致谢。
When I send e-mails using the package UTL_SMTP I am getting this error when executing the comand UTL_SMTP.MAIL:
501 5.1.7 Bad sender address syntax
I am passing olny the e-mail as second parameter. This occurs only with certain smtp servers.
The code is this:
sFrom := '[email protected]';
Utl_Smtp.Mail(Connection, sFrom);
Does anyone know how to fix this?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
发送电子邮件可能是个麻烦事,请参阅 SO 创建者的帖子:
http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html
如果这种情况仅发生在某些 smtp 服务器上,我会检查这些服务器的日志以了解它们抱怨的内容。
我对 SMTP 的了解有点模糊,但您不能只是连接到服务器并告诉它使用任意 FROM 地址发送电子邮件。向您的管理员询问详细信息。
Sending email can be a bitch, see the post of the SO creator:
http://www.codinghorror.com/blog/2010/04/so-youd-like-to-send-some-email-through-code.html
If this is only happening with some of the smtp servers, I would check the logs of those servers to see what they complain about.
My knowledge about SMTP is a bit dusty, but you can't just connect to a server and tell it to deliver an email with an arbitrary FROM addr. Ask your admin about details.
您可以尝试
sFrom := '[电子邮件受保护] < [电子邮件受保护]>'
某些 smtp 服务器需要地址由方括号
<>
分隔can you try
sFrom := '[email protected] <[email protected]>'
Some smtp servers require an address delimited by brackets
<>