Modules & VBA :: Specifying Email Address When Sending Email Via SMTP
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 Replies
ADVERTISEMENT
Nov 7, 2007
I'm using CDOSYS and SMTP in a vb function to send emails via Ms Access 2003.
My code loops through a recordset an sends an email to the email address in the table.
However, all works fine until an invalid email address is encountered, at which point I get an 'Invalid address' error message and the code halts (obviously). BUT, if use 'On Error Resume Next' I get no error message but all consequtive emails are NOT sent.
How can I get the code to ignore the invalid email and carry on sending emails throughout the recordset?
View 7 Replies
View Related
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 10 Replies
View Related
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
[Code] ....
View 3 Replies
View Related
Oct 8, 2015
I am trying to figure out how to make a button that sends an email to a specific email address, containing the information from 1 row.
we have rows where we put the the address, the quantity and the time interval we can collect the packages in. these information have to be send to a trucking company. I want access to send an email to the trucking company's email address, and not a whole report of all the rows, but be able to choose to send row 1,2,3 etc.
View 1 Replies
View Related
Jan 12, 2015
I'm working on a database for work that email's the current record after the form is completed. I have a attachment field in the table called Photo and some record's have a photo attached and other's don't. The code below works great with records that have a photo attached, but I get a path not found if I try to email a record that does not have a photo. I know that I need to put some form of code to check the photo field for a attachment, but I'm having a brain fade as to just what the code is.
Code:
Private Sub eMail_Report_Click()
Dim oFilesys, oTxtStream As Object
Dim txtHTML As String
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
[Code] ....
View 5 Replies
View Related
Dec 16, 2014
i am trying to send a email with a pdf-report attached based on a report (rap_factuur_klant_pdf).I am using MS Access 2007 and Outlook 2007..
Code:
Dim sAddr As String, sSubj As String, sFor As String
Again:
sAddr = InputBox("E-mail address:")
sSubj = "Report"
sFor = Left(sAddr, InStr(1, sAddr, "@") - 1)
DoCmd.SendObject acSendReport, rap_factuur_klant_pdf, acFormatPDF, sAddr, , , sSubj, "BLA BLA BLA"
DoEvents
View 5 Replies
View Related
Jun 25, 2013
I use a macro (SendObject), which works, but it requires Us, or someone to go into Outlook to click on send.I'm new to vba, do I have to code something on outlook to send automatically?
View 6 Replies
View Related
Nov 13, 2013
I have this code below in order to send query through outlook. How can I display the mail and not directly sending it?
Private Sub Command64_Click()
Dim message As String
Dim rs As Recordset
Dim vRecipientList As String
Dim vMsg As String
Dim vSubject As String
[Code] .....
View 5 Replies
View Related
Nov 21, 2013
Is it possible to send an email after pressing a button to an email address which is within a field? If so where should I start?
View 6 Replies
View Related
Nov 26, 2013
I am a College Instructor and I would like to make a Database that will regularly email me a list of Students who are approaching the mid-point of their Program.Is it possible to program Access to email a list with Student Names, Registration Numbers, etc, etc. by a given date?
As of right now I have a Database with all of the students' pertinent information but I have to manually comb through the Database each week to see which students will require a Mid-Term interview that week.
View 7 Replies
View Related
Aug 16, 2014
I have this VBA code:
Option Compare Database
Option Explicit
Private Const URL_CDOCONFIG As String = ""
Public Function SendEmail(ByVal sTo As String, ByVal sFrom As String, _
Optional ByVal sCC As String = "", Optional ByVal sBCC As String = "", _
Optional ByVal sSubject As String = "", Optional ByVal sBody As String = "", _
[Code] ....
It is being called with the following macro:
SendEmail("gregory.west@dbwsys.mb.ca","vba@dbwsys. mb.ca","","","Subject line","Body of eMail here")
But I get this error message.
The "SendUsing" configuration value is invalid.
View 1 Replies
View Related
Mar 12, 2014
How would I set up an Outlook email using a list of recipients from an Access table? I'd like to be able to run this from Access 2007 and not Outlook. However, once the email is set up, I'd like to be able to go into the email and add subject, body, etc. before sending the email.
View 5 Replies
View Related
Aug 26, 2013
I am trying to send an email from a form in Access 2013 using fields on the form as part of the email body and I can't seem to find code to just do this.
I don't need to loop through tables as the send email address etc will be on the form together with appointment times etc ...
View 2 Replies
View Related
Apr 24, 2015
I have code that allows me to drag and drop an email to an access field, which then stores that email on the local / network folder. Another field with that email's file path is also displayed.
My big question is: knowing the email's file path, how can I have the system open those (network/folder) saved emails as a reply (not automatic send)?
I envision this as being triggered by a _Change event; if a drop-down changes or is selected, then the system reads the location in the 'Email Location' field, and opens the reply to that email.
View 3 Replies
View Related
Feb 7, 2014
I have been able to create code to send email for my ticket system but now have a need to add an additional recipient. I would prefer this recipient to be add in the CC field. This email address will come from its own table. I have tried to figure this out myself but I can't get anything to work for me . I am fairly new to VBA and all of my experience is just through trial and error (mostly error). I have attached my original code below ....
Private Sub cmdMailTicket_Click()
On Error GoTo Err_cmdMailTicket_Click
Dim stWhere As String '-- Criteria for DLookup
Dim varTo As Variant '-- Address for SendObject
Dim stText As String '-- E-mail text
[Code] ....
View 1 Replies
View Related
Oct 1, 2013
I would like to update the following code I have been using to send emails, from Access 2010 via Outlook 2010, to include my signature block with hard returns in between each line and a few above the signature.
Lets say the signature would be:
My Name
My Company Name
My phone number
My Reference
I tried next to: stMessage = Me![EmailMessage] &"My Name" & Chr(10) & Chr(13) & "My Company Name"
etc.
It does not work..
Here is the coding :
Code:
Private Sub SendEmail_Click()
On Error GoTo ProcErr
Dim stLinkCriteria As String
[Code]....
View 5 Replies
View Related
Apr 16, 2014
Code:
Public Function OPEN_SESSION() As Boolean
Dim objSession As Object
Dim strServer As String
Dim strMailFile As String
[code]....
but for some reason my form is not updating after sending the email.
View 1 Replies
View Related
Aug 25, 2014
I would like to set a flag when a report gets emailed.
View 14 Replies
View Related
Nov 4, 2014
I have a field which contains various text including an email address which i need to extract.
My research says that I need to use a regex code but dont know how to get that into Access.
I have attached an example of the file i'm importing into Access.
View 5 Replies
View Related
Jul 14, 2014
I can already send emails out as PDF files when an email address exists, however, I'm trying to validate whether or not an email address does actually exist. My problem is, there are four possible locations where an email address could be: MainEmail or Contact1Email or Contact2Email or Email (the last one - Email - is in a separate table).
Four text boxes exist on the form that is being actioned (the form is based on a query to extract the relevant information) and are available to test for an email address being present. What I'm struggling with is ensuring that the 'To' box in Outlook always gets populated or Outlook chucks a hissy fit. I have been trying various IF Then Else and Do Loop plus a myriad of other ways but none are reliable, especially if no email address is present which can be the case.
View 14 Replies
View Related
Aug 21, 2014
My situation is that , I have a sub for sending an email to a single client on the current form. Using a record set works fine, I now wish to have
.Cc email address which is not part of the Record set ." its to the department head". strEmailAddress = rst![clientEmail] & " ;" & somebody@ntlworld.com
My question is can I type the somebody email address as indicated in red in the above line? to enable the email to go to both addressees .
set DoCmd.SendObject , , acFormatRTF, clientEmail, _ , , strSubject, strEMailMsg, False, False?
I would prefer to use the Do Cmd SendObject is this is achievable
View 2 Replies
View Related
Jan 23, 2014
I am currently updating an Access database, any way to send an OLE Object (in this case an Excel Spreadsheet) as an attachment to an email address using VBA code? I made a form that shows the Excel Spreadsheet when the record is brought up, but I need to know how to send just the Excel Spreadsheet and not the other information on the form.
Also, if there is an alternate way to have an Excel spreadsheet embedded into an Access form, i'm open to change. The user wants to be able to see the Excel spreadsheet and send it to their supervisor without having to locate the Excel spreadsheet on the hard drive.
View 2 Replies
View Related
Dec 18, 2014
I'm trying to set email address for "Cc" using "Like" but showing error 13 Type mismatch. Problem only red mark code either all are working fine.
Code:
Private Sub cmdSendMail_Click()
On Error GoTo ErrorHandler
Dim strTo As String
Dim strSubject As String
Dim strMessageText As String
[code]....
View 14 Replies
View Related
Sep 4, 2013
I have a question about sending secure emails by VBA code in MS-Access. I have a Access application within you also can also send emails by VBA code using outlook. Everything works fine, but now the recipient wants to receive the mails with a digital signature by S/MIME.
I got a digital certificate from the recipient as a pfx-file.
Is this possible in Access using outlook ?
I use MS-Access 2010 en Windows 7
View 3 Replies
View Related
Aug 27, 2014
I have access db sending report with outlook every Monday.
But the problem is if outlook is open when I start the db, email goes in to outgoing folder and msg box of outlook opens saying " outlook will close after countdown if I do not hit the "DO NOT EXIT" button or "EXIT AND SEND LATER" button.
If I hit "EXIT AND SEND LATER" button, it sends next time I open the outlook.
Is it possible to prevent outlook doing this?
View 14 Replies
View Related