Sindbad~EG File Manager
from flask import request, url_for,flash, render_template
from core import app
from flask import url_for
from datetime import datetime, date, time, timedelta
import requests,mandrill,json
class EMAIL:
# def sendMail(subject,html,to):
# # MANDRILL_API_KEY='XEs1ytJQpEwaZSq25YgB4Q' # IP ADDRESS ENABLED
# MANDRILL_API_KEY='3rql7lHFpPcoHnNAWYQTFQ' # IP ADDRESS not ENABLED
# mandrill_client = mandrill.Mandrill(MANDRILL_API_KEY)
# #Test mail id for all mails
# # is_test_mail = AbstractModel().settings_mail('is_test_mail')
# # if is_test_mail["setting_value"] != 0 :
# # is_test_mail_id = AbstractModel().settings_mail('is_test_mail_id')
# # to = is_test_mail_id["setting_value"]
# message = {
# 'from_email' : ' support@numerotec.com',
# 'from_name': 'Neurology Simplified',
# 'subject' : subject,
# 'recipients':to,
# 'html': html,
# "headers" :
# {"Reply-To": " support@numerotec.com"} ,
# 'to' : [
# {
# 'email':to,
# 'name':to,
# 'type':'to'
# }
# ]
# }
# result = mandrill_client.messages.send(message = message,send_async=True)
# return ('success')
def sendMail(subject,html,to):
from_mail_name = 'Neurology Simplified'
from_mail_id = 'support@numerotec.com'
# reply_mail_id = 'ntecBackup@gmail.com'
cc = []
bcc = []
url = 'https://api.mailgun.net/v3/mg.numerotec.com/messages'
auth = ('api','key-e13725db7c3a95b679911c038b490db1')
data = {
'from' : from_mail_name+'<'+from_mail_id+'>',
'to' : to,
'cc' : cc,
'bcc' : bcc,
'subject': subject,
'html' : html
}
# data['h:Reply-To']= reply_mail_id
res = requests.post(url, auth=auth, data=data)
return "success"
# def sendMailInMailGun(subject,html,to,cc=[],bcc=[]):
# url = 'https://api.mailgun.net/v3/numerotech.com/messages'
# bcc = ["tnoabackup@gmail.com"]
# auth = ('api', 'key-e13725db7c3a95b679911c038b490db1')
# data = {
# 'from' : 'TNOA <support@tnoa.info>',
# 'to' : to,
# 'cc' : cc,
# 'bcc' : bcc,
# 'subject': subject,
# 'html' : html
# }
# data['h:Reply-To']="Support <support@tnoa.info>" # <------------- HERE!
# res = requests.post(url, auth=auth, data=data)
# return "mail sent successful."
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists