Forms :: Add Senders Email Address To Body Of Email
Sep 16, 2013
I want to automate an email to include the senders email addres with some text in the body of the email.
Code:
Private Sub send_mail_Click()
Dim olApp As Object
Dim objMail As Object
On Error Resume Next 'Keep going if there is an error
Set olApp = GetObject(, "Outlook.Application") 'See if Outlook is open
I am currently using vb code to send an email in Access on the click of a button. I want the database user to be able to enter the recipient in a text box [ToEmail] which is on form [GroupStockProfiler]. However, I'm unsure how to put this into my code. I currently have the following which doesn't work (unless I put a specific email after 'To'):
I currently have a form with the below fields (example names)
FRMFormName001
Field001 Field002 Field003 Field004
RPTReportName001
Once the info is filled out we click a button that converts it into a report and once the information is confirmed correct you have to click another button Email it off, this is currently done by a macro creating the report as a attachment PDF File.
The system has now changed and they now want the details in the body of an Email, is it possible to make the details be copied straight into an Email body by a simple macro button click or similar?
I made a form in Acces now i want to make a button in that form that if a user click on it it wel open a new email message with the form in it.. so NOT if a attachement but directly in the email body.
I'm sure there is a way to do this true vba or something else...
I am a website administrator and don't want to send back a verification email as people register on my website. So, I am wondering whether there is a way for me to check the validity of their registered email addresses. How can I easily check whether an email address is valid or exists?
I almost have what I need, but I am not quite there. I am a VBA novice and need help. I couldnt understand some of the code I have searched for on this topic.
I have a query that returns exactly the results I want. By using a SendObject macro I can accomplish sending the message with a .txt file attached. What I want to do is instead of having the attachment I want to send my query "FaxReportQueryReport" in the body of the email. No set address, just a set RE: line of "Today's Deliveries".
I can create PDF's, DOCX's retaining the PDF formatting save them back to different network locations and then retrieve and attach to emails that are generated for different areas, however I have been asked to scrap the attachment and insert the content of the attachment directly into the body of the email. I have had a good browse around the net with no real approach. The code below simply gets the recepients email address adds the subject and then is looking for the .HTMLBody which simply comes through in the body as
"O:divAKLResgroupE - ReportsHTML FilesDRAFT TEST .html".
I have a query table in Access 2007 with requests pending an individuals review and approval. I would like to create an automatic email each day to that individual which includes the actual query table impeded as part of the body of the email (not as an attachment).
I'm trying to put multiple records of data from a subform in a single e-mail, and my Outlook calendar. I have a contracting business, and on my Orders form (which details a single client), I have a sub-form that lists all the items to be done at that client's home (a different record for each work item). When I send an e-mail, or post the appointment to the Outlook calendar, I am trying to list all those records in the body of the e-mail, and/or in the Notes section of the appointment. I created the query to call the records, but have not figured out a way to use it in the code.
With the code below , I send the report: “ESERT4H”, in email body. How I could add yet another report on the same body of the email ?
DoCmd.OutputTo acOutputReport, "ESERT4H", "HTML(*.html)", "D:Access empESERT4H.html", False, "", 0, acExportQualityScreen Dim Out As Outlook.Application Dim NS As Outlook.NameSpace Dim Folder As MAPIFolder Dim Mens As MailItem
I have a database to send e-mails from access trough Outlook. The issue is that I would like the body of the e-mail to have hyperlinks, colours, bolds and that I can get it from plain text.
This is the code I have:
Dim MyDB As Database Dim MyRS As Recordset Dim MyTable As Recordset Dim objOutlook As Outlook.Application Dim objOutlookMsg As Outlook.MailItem Dim objOutlookRecip As Outlook.Recipient Dim objOutlookAttach As Outlook.Attachment
[Code] ....
How can I make the body to be HTML format, or, can I have a e-mail template storaged in my PC and then indicate to use it whenever the e-mail is sent?
I am trying to work my way into putting the content of my report into the body of an e-mail. I have used the following code to do so but I keep on getting the error: "An Expression You Entered Is the Wrong Data Type for one of the Arguments"
Code: Private Sub Command278_Click() On Error GoTo ER Dim db As Database Dim rstOpenPurchaseOrders As Recordset Dim strSQL As String
how to properly get my email body to format correctly? I am obviously misusing the .HTMLbody/tags incorrectly. The email generates with the attachments as expected, but the email body message is just runon.
Code: Private Sub Command29_Click() Dim appOutLook As Outlook.Application Dim MailOutLook As Outlook.MailItem Set appOutLook = CreateObject("Outlook.Application")
I have a query where I collect data for different vendors and their purchase orders, products deadlines etc.
Is it possible via access to generate a report and via outlook send in the email body a message where is showing the purchase order date of delivery and priority? Or can that be done via a form?
I need to send different reports to a bunch of different persons every hour... I had several macros that did it for me, But Then they wanted me to include a e-mail body that was more than 255chars, so i had to go VBA and i have this (for every set of persons and Reports):
Private Sub Command38_Click() On Error GoTo ErrorHandler DoCmd.SendObject acReport, "REPORT NAME", "Extension", "EMAILS", "", "SUBJECT", "EMAIL BODY", True, "" ExitHandler: Set rs = Nothing Set db = Nothing Exit Sub ErrorHandler:
[code]....
so everything is good, but NOW they want the body of the email to contain another paragraph totally separated from the first one and they want it highlited and also in Red, How can i add Html to this or do i have to use another method?
I have tried this:
Public Sub TestEmail() Dim appOutLook As Outlook.Application Dim MailOutLook As Outlook.MailItem Set appOutLook = CreateObject("Outlook.Application")
[code]...
But it keeps on giving me errors, about objects not being defined.
I have a form bound to a table which stores contact info for a person. I have two controls that are email_address and website_address. I set them both as hyperlinks. So now when the user clicks on the email_address Outlook opens a new message with an email_address in the To field. (I had to use a function found on this forum to replace the "htttp" with "mailto" on AfterUpdate event in order for this to work properly.) However, now trying to add some other features to my DB I ran into problems listed below. I wonder if I should have rather left that control as Text instead of Hyperlink, and use the DoCmd.SendObject on doubleclick event instead of using the above solution. How people usually store email addresses and enable emailing on click?
The problems I ran into: 1) My main form is in popup mode and therefore right click on the hyperlink does not give an option to edit the hyperlink 2) I copied a function from this forum which gathers a list of emails and sends one message to the emaillist. However, my email list instead of generating as: email1@a.com; email2@b.com it generates as: email1@a.com#mailto:email1@a.com#; email2@b.com#email2@b.com#
I guess I could extract the email using vba (not sure how), but I still don't know how to solve issue number 1. So maybe it is better to siwtch the field to plain text and forget the hyperlinks?
Thanks, Mariusz
PS. What procedure on double click would open a default browser, since I also have to deal with web addresses and thought of turning them into text controls?
With this very simple command, I have the ability to send emails to several clients, reporting many things, quotations etc.
Private Sub Command84_Click() DoCmd.SendObject , , , , , , "SOMETHING", [SalesGroupingField] & "" & [1], True, "" End Sub
Now, i want, on the body of the emai, to display many records, it is from Nothwind, how can i display on the body of the email all records from this report?
I am attempting to modify some code that is used for reading content in an Outlook mail and need to catch and move the email if certain content is duplicated in the email.
The code reads the email that is in the attached image format:
As seen, this email contains 2 devices, but the Serial No in both is duplicated.
In the code, I need to capture this and rather than reading the contents, I need to just move this email to a separate "Manual" folder to be dealt with separately, so not to write the information to the database.
The current code is as follows:
Option Explicit Private ns As Outlook.Namespace Private sEmailAddress As String Private sPerson As String Private dReceived As Date
i have VBA code to create an email and attach an excel file, what i would like is code to add a report called REPORTMISSINGDATES to the body of the email.
this is the code i have so far, which works and adds everythng i wqant except the main body of the email.
Private Sub Command31_Click() On Error GoTo Command31_Click_Err Dim Email As String Dim name As Variant Dim EMPloy As Variant Dim month As Variant month = MonthName([Forms]![STAFFATTENDANCEMenu]![StaffMonth]) EMPloy = Forms!staffattendancezone!Staff name = DLookup("[STAFFNAME]", "[QRYSTAFFNAME]", "[ASA] = Forms!staffattendancezone!Staff") Email = (Forms!STAFFATTENDANCEAdjust!Email) DoCmd.SendObject acQuery, "STAFFATTENDANCEZONECheckEmployee", "ExcelWorkbook(*.xlsx)", [email], "", "", "" & "Attendance Errors", "THIS IS WHERE I WANT THE REPORT TO GO" _ End Sub