Description

Sends HTML file by email with attached files. But the method doesn't allow send a mail via smtp server with secure authentication.

Namespace:  DuoDimension.Databeam
Assembly:  Databeam.Word (in Databeam.Word.dll)
Version: 2.1.0.0

Syntax

      
 C#  Visual Basic 
public int SendHTMLMail(
	string FileName,
	string AddressFrom,
	string AddressTo,
	string Subject,
	string SmtpServerFrom,
	string UserName,
	string Password,
	ArrayList Attachments
)
Public Function SendHTMLMail ( _
	FileName As String, _
	AddressFrom As String, _
	AddressTo As String, _
	Subject As String, _
	SmtpServerFrom As String, _
	UserName As String, _
	Password As String, _
	Attachments As ArrayList _
) As Integer

Parameters

FileName
String
HTML file that will be send as an email.
AddressFrom
String
The address of sender.
AddressTo
String
The addres of recipient.
Subject
String
The theme of the letter.
SmtpServerFrom
String
Smtp server.
UserName
String
The user name for authentication on SMTP server.
Password
String
The password for authentication on SMTP server
Attachments
ArrayList
List of attached files.

Return Value

0 - Ok. File has been sent to the recipient.

1 - Can't open the file. Check FileName parameter.

2 - Smtp Server rejected the letter.

Examples

CopyC#
DuoDimension.Databeam.Word convert = new DuoDimension.Databeam.Word("*******");
if (convert.IsWordInstalled == true)
{
    convert.OpenDoc(@"D:\WordFile.doc");
    if (convert.ReturnCode == 0)
    {
        convert.DocToHtml(@"d:\testmail.html");
        if (convert.ReturnCode == 0)
        {
            ArrayList atch = new ArrayList();
            atch.Add(@"report.html");
            atch.Add(@"logo.jpg"); 
            convert.SendHTMLMail(@"d:\testmail.html",
                "frog@yahoo.com",
                "fox@hotmail.com",
                "my test",
                "smtp.server.net",
                "frog_user",
                "frog_pass",
                atch);
        }
    }
}
CopyVB.NET
Dim convert As New DuoDimension.Databeam.Word("*******")
If convert.IsWordlInstalled = True Then
    convert.OpenDoc("D:\WordFile.doc")
    If convert.ReturnCode = 0 Then
        convert.DocToHtml("d:\testmail.html")
        If convert.ReturnCode == 0 Then
            Dim atch As New ArrayList()
            atch.Add("report.html")
            atch.Add("logo.jpg")
            convert.SendHTMLMail("d:\testmail.html",
                "frog@yahoo.com",
                "fox@hotmail.com",
                "my test",
                "smtp.server.net",
                "frog_user",
                "frog_pass",
                atch)
        End If
    End If
End If

See Also