def run():
    #ExStart: RetrieveSMTPServerExtensions
    client = SmtpClient("smtp.gmail.com", 587, "username", "password")
    client.security_options = SecurityOptions.AUTO
    caps = []
    caps = client.get_capabilities()

    for str in caps:
        print(str)
def run():
    dataDir = "Data/"
    #ExStart: ForwardEmail
    eml = MailMessage.load(dataDir + "Message.eml")
    eml.from_address = "*****@*****.**"

    #Send using Smtp Client
    client = SmtpClient("smtp.gmail.com", 995, "username", "password")
    client.security_options = SecurityOptions.AUTO
    client.forward("*****@*****.**", "*****@*****.**", eml)
def run():
    #ExStart: SendingPlainTextMessage
    eml = ae.MailMessage()
    eml.subject = "Message with Plain Text Body"
    eml.body = "This is plain text body."
    eml.from_address = "*****@*****.**"
    eml.to.append(ae.MailAddress("*****@*****.**", "Recipient 1"))

    #Send using Smtp Client
    client = SmtpClient("smtp.gmail.com", 995, "username", "password")
    client.security_options = SecurityOptions.AUTO

    client.send(eml)
예제 #4
0
def run():
    #ExStart: SettingHTMLBody
    eml = ae.MailMessage()
    eml.subject = "Message with Html Body"
    eml.is_body_html = True
    eml.html_body = "<html><body>This is the <b>HTML</b>body</body></html>"
    eml.from_address = "*****@*****.**"
    eml.to.append(ae.MailAddress("*****@*****.**", "Recipient 1"))

    #Send using Smtp Client
    client = SmtpClient("smtp.gmail.com", 995, "username", "password")
    client.security_options = SecurityOptions.AUTO

    client.send(eml)
def run():
    #ExStart: SendEmailSynchronously
    eml = ae.MailMessage()
    eml.subject = "New MailMessage created with Aspose.Email for Python"
    eml.html_body = "<b>This line is in bold </b> while this is normal text"
    eml.from_address = "*****@*****.**"

    eml.to.append(ae.MailAddress("*****@*****.**", "Recipient 1"))
    eml.to.append(ae.MailAddress("*****@*****.**", "Recipient 2"))

    eml.cc.append(ae.MailAddress("*****@*****.**", "Recipient 3"))
    eml.cc.append(ae.MailAddress("*****@*****.**", "Recipient 4"))

    #Send using Smtp Client
    client = SmtpClient("smtp.gmail.com", 587, "username", "password")
    client.security_options = SecurityOptions.AUTO
    client.send(eml)
예제 #6
0
def run():
    dataDir = "Data/";
    #ExStart: SpecifyRecipientAddresses
    eml = ae.MailMessage()
    eml.subject = "New MailMessage created with Aspose.Email for Python"
    eml.html_body = "<b>This line is in bold </b> while this is normal text"
    eml.from_address = "*****@*****.**"

    eml.to.append(ae.MailAddress("*****@*****.**", "Recipient 1"))
    eml.to.append(ae.MailAddress("*****@*****.**", "Recipient 2"))

    eml.cc.append(ae.MailAddress("*****@*****.**", "Recipient 3"))
    eml.cc.append(ae.MailAddress("*****@*****.**", "Recipient 4"))

    #Send using Smtp Client
    client = SmtpClient("smtp.gmail.com", 587, "username", "password")
    client.send(eml)
예제 #7
0
def run():
    #ExStart: SSLEnabledSMTPServer
    client = SmtpClient()
    client.host = "smtp.gmail.com"
    client.port = 587
    client.username = "******"
    client.password = "******"
    client.security_options = SecurityOptions.SSLEXPLICIT
예제 #8
0
def run():
    #ExStart: SendingMeetingRequestsViaEmail
    eml = ae.MailMessage()
    eml.from_address = "*****@*****.**"
    eml.to.append(ae.MailAddress("*****@*****.**", "Recipient 1"))

    #Create Appointment instance
    app = Appointment("Room 112", dt.datetime(2018, 5, 27, 22, 12, 11),
                      dt.date(2018, 5, 28), eml.from_address, eml.to)
    app.summary = "Release Meetting"
    app.description = "Discuss for the next release"

    eml.add_alternate_view(app.request_apointment())

    #Send using Smtp Client
    client = SmtpClient("smtp.gmail.com", 995, "username", "password")
    client.security_options = SecurityOptions.AUTO

    client.send(eml)
예제 #9
0
def run():
    #ExStart: SetAlternateText
    eml = ae.MailMessage()
    eml.subject = "Message with Alternate Text"
    eml.is_body_html = True
    eml.html_body = "<html><body>This is the <b>HTML</b>body</body></html>"
    eml.from_address = "*****@*****.**"
    eml.to.append(ae.MailAddress("*****@*****.**", "Recipient 1"))

    # Creates AlternateView to view an email message using the content specified in the //string
    alternate = AlternateView.create_alternate_view_from_string(
        "Alternate Text")

    # Adding alternate text
    eml.alternate_views.append(alternate)

    #Send using Smtp Client
    client = SmtpClient("smtp.gmail.com", 995, "username", "password")
    client.security_options = SecurityOptions.AUTO

    client.send(eml)
def run():
    #ExStart: SendingBulkEmails
    message1 = MailMessage("*****@*****.**", "*****@*****.**",
                           "Sending Bulk Emails using Aspose.Email",
                           "message1, how are you?")
    message2 = MailMessage("*****@*****.**", "*****@*****.**",
                           "Sending Bulk Emails using Aspose.Email",
                           "message2, how are you?")
    message3 = MailMessage("*****@*****.**", "*****@*****.**",
                           "Sending Bulk Emails using Aspose.Email",
                           "message3, how are you?")

    manyMsg = MailMessageCollection()
    manyMsg.append(message1)
    manyMsg.append(message2)
    manyMsg.append(message3)

    #Send using Smtp Client
    client = SmtpClient("smtp.gmail.com", 995, "username", "password")
    client.security_options = SecurityOptions.AUTO

    client.send(manyMsg)