Modules & VBA :: Send Email From Access 2013 Through External SMTP Server?
Jun 5, 2015
I have Access 2013, Win 7, Outlook 2010 (32-bit).I want to send an email from Access, but not through Outlook. Instead I want to connect to an external SMTP server. I've found a few examples that doesn't work for me. With code including for example
Code:
Set ObjMessage = CreateObject("CDO.Message")
I get an "Error 429: Object can't be created in Active X-component" (My translation from Swedish).With code including this:
Code:
Dim oEMail As New CDONTS.EMail
I get "user defined type has not been defined" (my translation again).I have working code for sending email through Outlook, which works fine. But, Outlook adds a lot of span tags, making it impossible to read for certain screen readers used by visually impaired people, therefore I can't use Outlook.
I've tried to read up on the matter (CDO), and think that maybe the CDO library etc is not included on my computer?can I download it?
View Replies
ADVERTISEMENT
Jun 8, 2013
I'm using VBA and XML to send emails from my db to a legitimate mail server (Mandrill).
The mail server will accept any number of receipients in one go.
I'm using an SQL string to build up my recipients into one large string (phil@test.com; fred@test.com etc). This works well as it builds them list at about 50 per second.
The issue I have is that I get an error saying 'Too many recipents'.
How many will SMTP let me send in one go?
View 1 Replies
View Related
Jan 19, 2015
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'):
Private Sub Command414_Click()
Const cdoSendUsingPickup = 1
Const cdoSendUsingPort = 2
Const cdoAnonymous = 0
[code]...
View 1 Replies
View Related
Nov 24, 2014
I have an Access 2013 database which will generate a pdf report and attach it to an email using the code:
Code:
DoCmd.SendObject acSendReport, "Report Name", acFormatPDF, Nz(To email address, a), , , "Email Subject", "Email body", True
I would also like to automatically attach on the server to this email. Such a file stored such as servernamesharefilename.pdf. Is it possible to do this?
View 14 Replies
View Related
Aug 19, 2014
In previous versions of Access (i.e 2003 and prior) I could use the following code in the On Click event of a form's command button to open an external file:
Dim stAppName As String
stAppName = "C:Program FilesCadroTransPost PlusTransPostPlus.exe"
Call Shell(stAppName, 1)
However, I'm now using Access 2013 and it wont allow me to use this anymore, it gives me the following error:
Runtime Error '5"'
Invalid procedure call or argument
Why this doesn't work in Access 2013?
View 1 Replies
View Related
Dec 10, 2013
I need to send commands to an external device using a serial port.My understanding is that that I need to select the reference to the Microsoft Communications Control (MScomm32.ocx).But is not available in the list of references!
View 2 Replies
View Related
Feb 11, 2014
I have the code for sending an email but I only want to send a single email when there are records in a query and only when the database is first opened.
I hadn't considered this in my design so what structural requirements would it require if any?
View 5 Replies
View Related
Aug 1, 2013
I have an Access 2010 database which has a table with several fields with the Hyperlink data type. Some of these hyperlinks reference files stored in a SharePoint database. I am relatively new to using hyperlinks. The task is to insert those hyperlinks into an email using VBA so that the recipient can just click on them to view the documents.
I have no problems with using VBA to create emails or to add attachments. My issue is with adding hyperlinks to the body of the email.
View 12 Replies
View Related
Jul 2, 2015
I have a several templates in outlook 2003 for my charity work.
All is OK if I send the odd one now and again, but the workload is increasing with more and more at any one time. However having seen various posts on here, I was thinking I could set something similar in Access as well as keeping track of the payments & deposits more easily.
I am fine with to, cc,bcc, body, subject etc, but what I need to do is SendUsingAccount, but 2003 does not have this property, it started with 2007.
As well as sending on that particular account I also need the signature linked to that account.
I could add that signature by code if I can get the correct account and for some reason the signature is not added.
I tried using SendOnBehalfOfName which works as far as the correct email address is used, but still uses my default a/c.
As an aside, my Outlook session would always be open, so I will use GetObject and not CreateObject method, but would like not to have the warning dialogue in Outlook pop up all the time.
View 14 Replies
View Related
Jan 15, 2015
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
[Code] ....
View 7 Replies
View Related
Aug 13, 2014
I have inventory database, in database there is "NextScheduledMaintenance" field.
I want access to send email automatically when scheduled maintenance date due.
View 7 Replies
View Related
Feb 3, 2014
I'd like a command button to open Outlook and create a new email message with the To and Subject fields already populated with what I want, is there anyway to do this?
View 1 Replies
View Related
Aug 17, 2015
Is it possible to send an email from an access 2007 database with a category?
View 8 Replies
View Related
Oct 18, 2013
I am setting up a database to track preventative maintenance required for testing equipment in our repair shop. Some of my associates would like to be able to send e-mail notifications via the database when maintenance is due. I set up a query to show the people who need to receive an e-mail and a query to show the maintenance each person needs to perform.
Each person will need to perform more than one maintenance step each time. I would like to get it so that the database will loop through the first query and generate one e-mail for each person. I would like the e-mail to list all the steps that person would need to do (as shown in the second query). I know this would require setting up loops and I'm afraid I'm not very good at writing loops.
I think this will need two loops. One to loop through the first query to see all the e-mails that will need generated and one to loop through the actions to be included in each e-mail. The person's name is included in both queries and can be used to set up a link between the two.
View 5 Replies
View Related
Dec 17, 2013
I'm using ACCESS 2010. I have a form which is having a embedded word document. What I'm trying to do is i want to enable user to format a mail in the embedded word document which will contain rich text and screenshots then with a click of button an outlook mail should open and content of this document should be pasted there. Once user sends this email, I want to save content of embedded document in the database.
View 4 Replies
View Related
Jul 31, 2013
What is the best way to send a single email to multiple recipients?
View 14 Replies
View Related
Jun 2, 2005
Does anyone know if it is possible to send an email when a button is clicked?
View 1 Replies
View Related
Jul 18, 2007
I currently have a database which logs issues that come in to me from the business. The database has been designed to keep all stakeholders informed of there request and for the user to write to the stakeholder with a responce through Access. (The reason for this is so the database keeps track of all responses sent back to the stakeholder.)
However even though i am using a memo box the database will only send about 255 characters and no more. I understand this is the max value for a text box however this should not be the case for a memo box. :eek: :confused:
Is there anything i can do i am currently using the following code:
cmdEmailAssignedTo : On Click
="ID " & [ID] & ": " & [Title] & " Status: " & [status]
My database is almost complete just having this one problem... is it a function within access that can not be resolved?
I will send the database over if needs be...
Thank you in advance,
Jay :eek:
(Slinky)
View 7 Replies
View Related
Aug 29, 2004
I'm updating a database that automatically sends an email to the drafts folder of Outlook. The developer that created the database used VBA code to call html code written in a table. The html code contains the body of the letter. I've figured out most of it but I need to include a date (one month from the current date) in the body of the letter. Unfortunately I've been researching java script and html all weekend and still haven't managed to figure that one out. Can anyone out there help with this? Also is this normal to include html and javascript in Access, I have never seen it before. Are the benefits good? I have serious studying to do if this is the case.
View 1 Replies
View Related
May 30, 2014
I currently have two e-mail accounts on my computer. One is my default e-mail address with my name on it. The other e-mail account is a generic account with the department name.
I have a database set up to generate and send e-mails to our technicians notifying them when an order they placed gets put on back order. This database could possibly send twenty or thirty e-mails out each time it is run. My manager has requested that the database send the e-mails from the generic e-mail account instead of the default account. That way, when the field replies to the e-mail, they won't bombard my account.
Is there a way to tell the database which e-mail account to send an e-mail from?
I am currently using the below module to send the e-mails:
Option Explicit
Dim appOutlook As Outlook.Application
Dim namespaceOutlook As Outlook.NameSpace
Sub Outlook_SendMail(sEmailAddr As String, sEmailSubj As String, sEmailBody As String, Optional sAttach1 As String, Optional sAttach2 As String)
[Code] ....
View 2 Replies
View Related
Jan 4, 2014
Is there a way of doing the above? I have several distribution lists (some >100 recipients) defined in Outlook, and would like to use the Docmd. Send Object command to send messages to one or several of them. I cannot find a way of defining a distribution list as any of the To, Cc or Bcc parameters.
View 2 Replies
View Related
Nov 4, 2013
I am using Access 2007 and are a newbie.
I am using the following code (Sendobject) to create a PDF of a report and send it via email to a customer's email address.
Private Sub EmailWorkOrderQuote_Click()
On Error GoTo Err_EmailWorkOrderQuote_Click
Dim stDocName As String
Dim mFilename As String
Dim mEmailAddress As String
[Code] ....
It works fine except that the I want to to able to utilize the ability to send the email with either both the CC and BCC or either or neither as well.
I have a table called "My Company Information" that contains the email addresses for the CC and BCC. If I have values in these fields, everything works great! If I have no values in either of these fields, I get "Invalid use of Null"....
I want to be able to use either both CC and BCC, either CC or BCC, or neither used and it still work.
View 9 Replies
View Related
Dec 18, 2014
After I have run all my access queries is it possible to send a conditionally formatted excel worksheet all in access using vba?
View 1 Replies
View Related
May 24, 2014
I have created some code to get the records of a query and it puts them in the body of the email but it doesn't format it well for example the email looks like
James | halliwell | 31
Leanne | smith |27
Alexis | smith |8
I would like it to be in a table is this possible,
Code:
Public Function SendEmail()
Dim MyDB As DAO.Database
Dim rst As DAO.Recordset
Set MyDB = CurrentDb
[Code] .....
View 3 Replies
View Related
Mar 17, 2014
I have some code that takes from a query, an email address and sends out an email.Due the security warning that happens for each individual email, i want to create ONE email for all email address in the query and populate them to the BCC section of the sendobject.Here is the code that I currently use
Code:
Private Sub cmdSendEmail_Click()
Dim MyDB As DAO.Database
Dim rsEmail As DAO.Recordset
Dim sToName As String
Dim sSubject As String
Dim sMessageBody As String
[code]...
I want to populate the BCC field with multiple emails addresses seperated by ":" and send just one email.
View 4 Replies
View Related
Jan 12, 2007
Is there any code that will allow me to send an e-mail as "High Priority / High Importance" through Access?
Here is the code I am using currently:
Private Sub Save_Click()
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim mail
Set mail = Nothing
' Send by connecting to port 25 of the SMTP server.
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
Const cdoSendUsingPort = 2
'==== A/R 60 Code Start ====
ElseIf Me![A/R Code] = "60" Then
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
' Set the CDOSYS configuration fields to use port 25 on the SMTP server.
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
'ToDo: Enter name or IP address of remote SMTP server.
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "usahm204.amer.corp.eds.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 10
.Update
End With
' Build HTML for message body.
strHTML = "<HTML>"
strHTML = strHTML & "<HEAD>"
strHTML = strHTML & "<BODY>"
strHTML = strHTML & "This is an automated e-mail to let you know that <b><font color=#FF0000>" & [Name of Requestor] & "</b></font> from <b><font color=#FF0000>" & [Department of Requestor] & "</b></font> has submitted a new <b><font color=#FF0000>A/R " & [A/R Code] & "</b></font> request in PERD."
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"
' Apply the settings to the message.
With iMsg
Set .Configuration = iConf
.To = "<Carol.Patukonis@examhub.exch.eds.com>" 'ToDo: Enter a valid email address.
.Cc = "<Elisa.Chandler@examhub.exch.eds.com>;<Deborah.Davis@examhub.exch.eds.com>"
.Bcc = "<Carlene.Vitello@examhub.exch.eds.com>;<Jason.Boney@examhub.exch.eds.com>"
.From = "PERD Request<Jason.Boney@eds.com>" 'ToDo: Enter a valid email address.
.Subject = "New A/R " & [A/R Code] & " Request"
.HTMLBody = strHTML
.Send
End With
' Clean up variables.
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
'==== A/R 60 Code End ====
I have tried using .Priority = "High" and .Importance = "High", but I keep getting an error stating this object property is invalid. What can I use to set a priority (Low, Normal, High) on the e-mail using the above code?
View 11 Replies
View Related