I am trying to send emails, using my custom domain. Searching, I find a python code and it's work with gmail/hotmail. I already have problems when I try to register an email using the domain in an email marketing platform
This is the python code:
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import smtplib
msg = MIMEMultipart()
msg["From"] = "[email protected]"
msg["To"] = "[email protected]"
body_text = "testt
"
body_part = MIMEText(body_text, 'plain')
msg.attach(body_part)
with smtplib.SMTP(host="smtp.mydomain", port=587) as smtp_obj:
smtp_obj.starttls()
smtp_obj.ehlo()
smtp_obj.login("[email protected]", "mypassword")
smtp_obj.sendmail(msg['From'], [msg['To'],], msg.as_string())
Appreaciate any help. I think it's needed to config something in cpanel. Maybe the DNS? I really dont want to alter the DNS records, because it has a lot of things working and it's to screw up the whole system (at least for me xD)
This is the python code:
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import smtplib
msg = MIMEMultipart()
msg["From"] = "[email protected]"
msg["To"] = "[email protected]"
body_text = "testt
body_part = MIMEText(body_text, 'plain')
msg.attach(body_part)
with smtplib.SMTP(host="smtp.mydomain", port=587) as smtp_obj:
smtp_obj.starttls()
smtp_obj.ehlo()
smtp_obj.login("[email protected]", "mypassword")
smtp_obj.sendmail(msg['From'], [msg['To'],], msg.as_string())
Appreaciate any help. I think it's needed to config something in cpanel. Maybe the DNS? I really dont want to alter the DNS records, because it has a lot of things working and it's to screw up the whole system (at least for me xD)
Last edited by a moderator: