473,385 Members | 1,506 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Can Access autosend email through SMTP (w/o download) or through squirrelmail?

Hey everybody,
I'm developing a database in Access 2002 for my school's journal to track incoming articles as they make their way through publication. Only 1 editor is reading an article at a time, but many have access to the database and may update information about the article (expedite requests, etc.)

What I want is that if editor 1 enters his name as "reader," then editor 2 updates the information about the article, an email is automatically sent to editor 1.

Here's the catch- b/c I don't have administrator privileges on our network, I can't download any programs to run as part of this process. This means no outlook, no firefox, and primarily, no SMTP add ons. So, is there any way that I can either (1- preferred) send the emails through SMTP without downloading any auxiliary programs, or (2- not ideal but possible) have access open internet explorer, go to webmail, log in (to the journal's email), send the mail, and close IE? I would probably want it to be run on moving to the next record or (esp. for #2) on close of Access. If it makes it any easier, the database would always be run from the school's server, and all email addresses would be ones on the school's network (first.last@school.edu).

I'm a relative programming novice, so any help is greatly appreciated. Thank you!
-Adam
Mar 22 '07 #1
2 2267
nico5038
3,080 Expert 2GB
I guess that the system manager closed the email for preventing spamm bots to work. This will however effect your application too.

The IE route could be an alternative. Just place the browser control and explore the possibilities for the HTMLdocument to achieve your goal.

Nic;o)
Mar 25 '07 #2
Denburt
1,356 Expert 1GB
Have you tried
Expand|Select|Wrap|Line Numbers
  1. Docmd.SendObject acSendReport,"Your Report"
?
If that won't work you can try heading up and use CDO.

The problem is locating the exchange server, once you do that your in. There are a lot of commands some of which are commented out since they weren't needed for my purpose. I use this to export a report to html then use that as a html body for my e-mails. Works quite nicely once you find the server and get it up and running good luck let me know if I can help.
Oh and you will need to set a reference to CDO in the VBA window go to tools references and look for Microsoft CDO for exchange.

Expand|Select|Wrap|Line Numbers
  1. Public Function CPExp()
  2. Dim strTo As String, strFrom As String
  3. Dim stSub As String ' Subject
  4. Dim stMsg As String ' Body of Message
  5. Dim stRpt As String ' Name of Report
  6. Dim strCC As String
  7. Dim strBcc As String
  8. Dim iMsg As New CDO.Message
  9. Dim iConf As New CDO.Configuration
  10. Dim Flds
  11. Dim FSO, ts, tsR, i As Integer, Cnt(3)
  12. stRpt = "My Report"
  13. strTo = "1@2.com"
  14. strCC = "2@3.com"
  15. strBcc = "3@4.com"
  16. strFrom = "Me@4.com"
  17. stSub = "...My subject..."
  18. stMsg = "The attached file is the latest Example Report."
  19. DoCmd.OutputTo acOutputReport, "YourReport", acFormatHTML, Application.CurrentProject.Path & "\RD.HTML", False
  20.  
  21.  Set FSO = CreateObject("Scripting.FileSystemObject")
  22.  Set ts = FSO.OpenTextFile(Application.CurrentProject.Path & "\RD.HTML", ForReading, True) '.CreateTextFile(vFile)
  23.  tsR = ts.ReadAll
  24.  
  25. Application.CurrentProject.Path & "\RD.HTML", False
  26. Const cdoSendUsingPort = 2
  27. Const strSmartHost = "YourExchangeServer" 
  28. Set iMsg = CreateObject("CDO.Message")
  29. Set iConf = CreateObject("CDO.Configuration")
  30.  
  31. ' Set the configuration fields.
  32. Set Flds = iConf.Fields
  33.  
  34. ' Set the proxy server to be used.
  35. Flds.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
  36.  
  37. ' TODO: Set "someproxy:80" to the name of your proxy server.
  38. 'Flds("http://schemas.microsoft.com/cdo/configuration/urlproxyserver") = "?Exchangeserver"
  39. Flds.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
  40.  
  41. ' Set if this is a local server.
  42. 'Flds("http://schemas.microsoft.com/cdo/configuration/urlproxybypass") = "<local>"
  43.  
  44. ' Set the option to retrieve the latest content directly from the server.
  45. Flds("http://schemas.microsoft.com/cdo/configuration/urlgetlatestversion") = True
  46. Flds.Update
  47.  
  48. ' Set the message properties.
  49. With iMsg
  50. Set .Configuration = iConf
  51. ' Create the MIME representation of the Web page in the message.
  52. '.CreateMHTMLBody = "http//whatever.com"
  53. .HTMLBody = tsR '"<html><body><p>Hello </p></body></html>"
  54. '.CreateMHTMLBody Application.CurrentProject.Path & "\RD.HTML"
  55. .To = strTo
  56. .CC = strCC
  57. .BCC = strBcc
  58. .From = strFrom
  59. .Subject = stSub
  60. .Send
  61.  
  62. Set .Configuration = Nothing
  63. Set Flds = Nothing
  64. Set iConf = Nothing
  65. Set iMsg = Nothing
  66.  
  67. End With
  68.  
  69. End Function
  70.  
Mar 25 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: peetm | last post by:
I'd like to write to a log whenever a visitor to my site downloads a file. So, I'd like the link they click to be to a php 'page' that returns the file. Don't know how to do that! Side...
4
by: Colin Kingston | last post by:
Hi For a college project I intend to produce a web based access database which will allow a group leader to send the same email to group members registered for that group. I want the group...
1
by: mamatha | last post by:
Hi i want the source code to send Emails through SMTP server in VB and received using IMAP in VB please help me mamatha
6
by: aljosa.mohorovic | last post by:
I have a problem when doing indirect download of file through php, when I click on download link Firefox and Internet Explorer give me same options: Open and Save. Firefox opens file directly from...
0
by: ravibrl | last post by:
Hey I need c++ code to access a webpage and download some software. If I execute that it should download that software and it should install it in my system. Give suggestions how to write that code...
6
by: ttamilvanan81 | last post by:
Hai, I need to send and receive Email's using VB and Ms-Access. Am using the following code. If i run this code, i has the error message as, Compile Error User-defined type not defined in the...
2
usafshah
by: usafshah | last post by:
How can i send email using php through SMTP server ?
1
by: piyush1414 | last post by:
Dow can I access Hard Drive Smart information through JavaScript...
2
by: cooksc | last post by:
I have an Access database where I want to send a PDF file as an attachment. I have code that sends the basic email from Access through LotusNotes and it works well. What I would like help on is:...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
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
0
BarryA
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...
1
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.