Email form details in Email body (1 Viewer)

stu_c

Registered User.
Local time
Today, 15:51
Joined
Sep 20, 2007
Messages
489
Hi all
currently I have a form we fill out and then it gets Emailed as a PDF attachment, unfortunately the details now need to be in the body of an Email and not an attachment how do I do this?

I have a template of the Email layout with a table inserted and the details need to go in a specific place is this possible?
 

ashleedawg

"Here for a good time"
Local time
Today, 07:51
Joined
Jun 22, 2017
Messages
154
Anything is possible!:rolleyes:

So, the data is coming from an Access Table? How much data are we talking about? Could you post an example of what the email needs to look like?
 

ashleedawg

"Here for a good time"
Local time
Today, 07:51
Joined
Jun 22, 2017
Messages
154
This sub creates an email with a plain-text version of any Access report, listed line-for-line in the body of the email:

Code:
Public Sub olSendRpt(strTo As String, strBody As String, strSubject As String, strReportName As String)
    'A procedure to send report in a body of mail message
    'Alex Dybenko, http://Alex.Dybenko.com
    
    'Usage: olSendRpt "Send@To.com", "Pls see report below", "My Report", "Report1"
    
    
    Dim strFileName As String, intFile As Integer, strLine As String, strTemplate As String
    
    strFileName = Environ("Temp") & "\rep_temp.txt"
    
    If Len(Dir(strFileName)) > 0 Then
        Kill strFileName
    End If
    DoCmd.OutputTo acOutputReport, strReportName, acFormatTXT, strFileName
    
    intFile = FreeFile
    Open strFileName For Input As #intFile
    Do While Not EOF(intFile)
        Line Input #intFile, strLine
        strTemplate = strTemplate & vbCrLf & strLine
    Loop
    Close #intFile
    
    DoCmd.SendObject acSendNoObject, "", acFormatTXT, strTo, , , strSubject, strBody & strTemplate

End Sub
But I suspect you need something more specific?
 

Users who are viewing this thread

Top Bottom