Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Sending HTML-Mails from Filemaker..


This topic is 8408 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

OK, since many people mailed me about how to send a HTML mail from Filemaker, here it goes:

The Database

- Create three global fields (Recipient,Subject,HTMLBody)

- Put the Recipients name in the Recipient field

- Put the Subject in the Subject field

- Put the HTML you want to appear in the mail in the HTMLBody field

- Export the three fields to C:tmp.txt

- Use the Send Message script step: Open Application/Document and specify my nifty application

Nifty application??

- Use Visual Basic to create an application and use the following sourcecode:

code:


Private Sub Main()

Dim strAddress As String

Dim strSubject As String

Dim strHTMLBody As String

Dim objOutlook As New Outlook.Application

Dim objMailMessage As Outlook.MailItem

On Error Resume Next

'Open the exported file, read the records and kill it afterwards

Open "C:tmp.txt" For Input As #1

If Err.Number <> 0 Then

MsgBox "An error has occurred!" & vbNewLine & "This programs cannot be started

without the existance of ""C:tmp.txt""...", vbOKOnly + vbCritical, "Error"

Exit Sub

End If

Input #1, strAddress

Input #1, strSubject

Input #1, strHTMLBody

Close #1

Kill "C:tmp.txt"

'Send the HTML mail using the imported fields

Set objMailMessage = objOutlook.CreateItem(olMailItem)

With objMailMessage

.display False

.SentOnBehalfOfName = "[email protected]"

If (InStr(1, strSubject, "Status call") > 0) Or _

(InStr(1, strSubject, "Uw call is opgelost") > 0) Then

End If

.To = strAddress

.Subject = strSubject

.HTMLBody = strHTMLBody

.Send

End With

Set objMailMessage = Nothing

End Sub


This program reads the C:tmp.txt and uses its contents to create a HTML mail using Outlook.

Perfect huh? wink.gif" border="0

Greetz,

Jorick

[ November 28, 2001: Message edited by: Jorick Schram ]

This topic is 8408 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.