Monday, November 14, 2016

Send mail with outlook


    Description255             recipientEmail;
    Notes                            emailBody;
    Description255             subjectText;
    Filename                       fileName;
    SmmOutlookEmail         smmOutlookEmail = new SmmOutlookEmail();
  
    recipientEmail = "test@hotmail.com";
    subjectText     = "Test Email";
    fileName          = @"C:\Users\admin\Desktop\test.jpg";
    emailBody       = "Hi,\nThis is a test email";
  
    if (smmOutlookEmail.createMailItem())
    {
        smmOutlookEmail.addEMailRecipient(recipientEmail);
        smmOutlookEmail.addSubject(subjectText);
        smmOutlookEmail.addFileAsAttachment(fileName);
        smmOutlookEmail.addBodyText(emailBody);
        smmOutlookEmail.sendEMail(smmSaveCopyOfEMail::No,true);// false for outlook popup
    }
    else
    {
        error("Could not communicate with Microsoft Outlook Client.");
    }

0 yorum:

Post a Comment