Hello all, I have this interesting problem and it has me scratching my head. I have updated a few forms to use CDOSYS to email instead of using the doCmd.SendObject. -
Dim objMessage As Object
-
Dim strFromEmail As String
-
Dim intCaller As Integer
-
Dim strCallerComments As String
-
Dim strCallerEmail As String
-
Dim strCallerPhoneNumber As String
-
Dim strHTMLBody As String
-
Dim strDateOfCall As String
-
Dim strCallerName As String
-
Dim strAssignedTo As String
-
-
strFromEmail = DLookup("[E-Mail Address]", "[CSD Personnel]", "[CSD Name] = '" & txtCallLogBy.Value & "'")
-
strAssignedTo = DLookup("[CSD Name]", "[CSD Personnel]", "[Initials] = '" & Initials.Value & "'")
-
intCaller = UserID.Value
-
strCallerName = DLookup("[UserName]", "[Users2]", "[UserID] = " & intCaller)
-
strCallerComments = CallerComments.Value
-
strCallerEmail = DLookup("[E-MailAddress]", "[Users2]", "[UserName] = '" & strCallerName & "'")
-
strCallerPhoneNumber = DLookup("[PhoneNumber]", "[Users2]", "[UserName] = '" & strCallerName & "'")
-
strDateOfCall = CallDateTime.Value
-
-
strHTMLBody = "<h1>Call Log Email</h1><br><br>" & stSubject & "<br><br>"
-
strHTMLBody = strHTMLBody & "<b>Assigned To:</b> " & strAssignedTo & "<br><br>"
-
strHTMLBody = strHTMLBody & "<br><br><b>Caller's Name:</b> " & strCallerName & "<br><br>"
-
strHTMLBody = strHTMLBody & "<b>Caller's Email:</b> " & strCallerEmail & "<br><br>"
-
strHTMLBody = strHTMLBody & "<b>Caller's Phone Number:</b> " & Format(strCallerPhoneNumber, "(###) ###-####") & "<br><br>"
-
strHTMLBody = strHTMLBody & "<b>Reason For Calling:</b> " & strCallerComments & "<br><br>"
-
strHTMLBody = strHTMLBody & "<b>Date Of Call:</b> " & strDateOfCall
-
-
Set objMessage = CreateObject("CDO.Message")
-
objMessage.Subject = stSubject
-
objMessage.From = strFromEmail
-
objMessage.To = stSendTo
-
objMessage.HTMLBody = strHTMLBody
-
objMessage.Configuration.Fields.Item _
-
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
-
-
'Name or IP of Remote SMTP Server
-
objMessage.Configuration.Fields.Item _
-
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.truecos.com"
-
-
'Server port (typically 25)
-
objMessage.Configuration.Fields.Item _
-
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
-
objMessage.Configuration.Fields.Update
-
objMessage.sEnd
-
This is the code that in 3 of 4 forms is working correctly. On the form that isn't sending, I have stepped through the entire procedure, and set a watch on objMessage. Once I pass send, the object correctly has a sent date, but no email comes!
I am using Access 2003, XP Pro.
Does anyone have any thoughts or ideas?
Thanks,
squiggly12
2 1350
Hi, there.
From the code you've posted it is not obvious whether objMessage.To property is being set correctly. Anyway, if the code doesn't raise an error, then, I guess, it means that email was sent but wasn't delivered by mail server.
Regards,
Fish.
Hi, there.
From the code you've posted it is not obvious whether objMessage.To property is being set correctly. Anyway, if the code doesn't raise an error, then, I guess, it means that email was sent but wasn't delivered by mail server.
Regards,
Fish.
Fish,
Thank you for the reply. I have checked all of the variables and they are being set correctly, and the sent date within the objMessage object is happening. I will have our network admin check the mail server to see if there are mails being stopped. The thing that is bothering me is that on 3 other forms, the same exact code is being used and emails are generated and sent.
Thanks again!
Sign in to post your reply or Sign up for a free account.
Similar topics
by: bebelino |
last post by:
Hello,
I've asked this same question two weeks ago or so. So, this is my last
shot in hoping there's one person with an answer.
I use a lot of SQL statements in my VBA-code. I do it like this:...
|
by: Clément Collin |
last post by:
I working on a GIS project, with Access link which just need a little
routine in VBA, but I haven't knowledges in VBA language.
It's very simple, and it looks like that in a TPascal way :
.......
|
by: Steve Jorgensen |
last post by:
Recently, I tried and did a poor job explaining an idea I've had for handling
a particular case of implementation inheritance that would be easy and obvious
in a fully OOP language, but is not at...
|
by: Terry Bell |
last post by:
We've had a very large A97 app running fine for the last seven years.
I've just converted to SQL Server backend, which is being tested, but
meanwhile the JET based version, running under terminal...
|
by: Cheryl Langdon |
last post by:
Hello everyone,
This is my first attempt at getting help in this manner. Please
forgive me if this is an inappropriate request.
I suddenly find myself in urgent need of instruction on how to...
|
by: Niyazi |
last post by:
Hi all,
What is fastest way removing duplicated value from string array using vb.net?
Here is what currently I am doing but the the array contains over 16000
items. And it just do it in 10 or...
|
by: Striker |
last post by:
I have never used VB, so sorry for the novice questions. I have a very
small app in vba that only uses excel as a place to put a button and some
code that I need to move to VB. Now it seems...
|
by: gunimpi |
last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431
********************************************************
VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help
wanted...
|
by: olle |
last post by:
How to deal with a VBA-project that is damaged?
Hi everyone.
I am BigOlle from sweden and I have been working with Accees for ten
years
I am now working on a project that started in Access97...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |