企业邮箱:企业邮箱是企业为员工提供的电子邮件服务,通常以企业自有的域名作为邮箱后缀。企业邮箱不仅用于日常的邮件沟通,还可以用于企业内部管理、文件共享、会议安排等。
域名邮箱地址:域名邮箱地址是指使用企业或个人注册的域名作为邮箱后缀的电子邮件地址。例如,如果企业注册了域名 example.com,那么员工的邮箱地址可能是 john@example.com。
以下是一个简单的Python示例,演示如何使用smtplib库发送邮件:
import smtplib
from email.mime.text import MIMEText
# 邮件配置
sender = 'sender@example.com'
receiver = 'receiver@example.com'
subject = 'Test Email'
message = 'This is a test email.'
# 创建邮件对象
msg = MIMEText(message)
msg['Subject'] = subject
msg['From'] = sender
msg['To'] = receiver
# 发送邮件
try:
smtp_server = smtplib.SMTP('smtp.example.com', 587)
smtp_server.starttls()
smtp_server.login(sender, 'password')
smtp_server.sendmail(sender, receiver, msg.as_string())
smtp_server.quit()
print('Email sent successfully!')
except Exception as e:
print(f'Error sending email: {e}')希望以上信息对你有所帮助!如果有更多问题,欢迎继续提问。