Sindbad~EG File Manager

Current Path : /home/numerotech/mobileapp.aios-scientificcommittee.org/aiosapp/core/library/
Upload File :
Current File : //home/numerotech/mobileapp.aios-scientificcommittee.org/aiosapp/core/library/email.py

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,society):
		cc      = []
		bcc     = []
		url  = 'https://api.mailgun.net/v3/aios-online.com/messages'
		auth = ('api', 'ca729f3ffe93314f0ffa929f6c4c76fc-ac3d5f74-07177449')
		data = {
        'from'   : society['society_title']+'<'+society['e_from_mail_id']+'>',
        'to'     : to,
        'cc'     : cc,
        'bcc'    : bcc,
        'subject': subject,
        'html'   : html
        }
		
		data['h:Reply-To']= society['e_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