我必须在注册完成后向客户发送邮件。我使用了codeigniter的内置电子邮件功能。邮件发送成功但不在索引,垃圾邮件文件夹中。我用下面的代码发送邮件:
#!/usr/bin/env python
import cx_Oracle
import sys
import csv
import os.path
import subprocess
con = cx_Oracle.connect('creden/tials@(DESCRIPTION =(ADDRESS_LIST =(ADDRESS =(PROTOCOL = TCP)(Host =server.work.net)(Port = 3453)))(CONNECT_DATA = (SID = SQLTEST)))')
cur=con.cursor()
f=open('/usr/local/src/sql/script_01.sql')
full_sql=f.read()
sql_commands=full_sql.split(";")
for sql_command in sql_commands:
cur.execute(sql_command)
# Here is where the magic should happen
# The output of above should go to the 'test_query' file
query_results = <OUTPUT OF FOR LOOP>
c=csv.writer(open("/home/user/sqlplus/test_query/test_query.csv","w"),delimiter=";",lineterminator="\r\n")
c.writerows(query_results)
cur.close()
我该如何解决这个问题?