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 sendMailInMailGun(subject,html,to,society):
MANDRILL_API_KEY='md-WHhIRdtiJJHa7wD0_WY6pQ' # IP ADDRESS ENABLED
mandrill_client = mandrill.Mandrill(MANDRILL_API_KEY)
message = {
'subject' : subject,
'recipients':to,
'from_name': society['society_title'],
'from_email' : society['e_from_mail_id'],
'html': html,
"headers" :{"Reply-To": society['e_reply_mail_id']} ,
'to' : [{
'email':to,
'name':to,
'type':'to'
}]
}
result = mandrill_client.messages.send(message = message,send_async=True)
return ('success')
# def sendMailInMailGun(subject,html,to):
# cc = []
# bcc = []
# url = 'https://api.mailgun.net/v3/numerotech.com/messages'
# auth = ('api', 'key-e13725db7c3a95b679911c038b490db1')
# data = {
# 'from' : Auth.getSociety()['from_mail_name']+'<'+Auth.getSociety()['from_mail_id']+'>',
# 'to' : to,
# 'cc' : cc,
# 'bcc' : bcc,
# 'subject': subject,
# 'html' : html
# }
# data['h:Reply-To']= Auth.getSociety()['reply_mail_id']
# # res = requests.post(url, auth=auth, data=data)
# return "mail sent successful."
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists