先上最重要的干货
发送邮件正文及主题的时候一定要使用convert重新编码
主题:
utl_smtp.write_raw_data(l_mail_conn, utl_raw.cast_to_raw(convert(‘Subject:‘ || p_subject || utl_tcp.crlf, ‘ZHS16GBK‘)));
正文内容:
utl_smtp.write_raw_data(l_mail_conn, utl_raw.cast_to_raw(convert(p_text_msg, ‘ZHS16GBK‘)));
附件路径:
l_file := convert(l_file, ‘ZHS16GBK‘);
参考资料:
Email From Oracle PL/SQL (UTL_SMTP)
时间: 2024-10-27 06:49:32