|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
I am working on a simple log database for a coworker in my office. She has the need to pull records from an Access db and email them. I know there are various ways of doing this thru the menus in Access, but she would like to have the process automated as much as possible. So, I am stuck with the task of writing code to dynamically generate an email from the results of a query. By itself this is easy enough, but some of the information in the email needs to be hyperlinked to .pdf files on our servers and she does not want the whole path to the file displayed as the link. Is html my only option? If so how do I make Access generate html and copy/import that html as the body of an email in Outlook 2k? Are there any other solutions you can think of? Thanks for your time...
Forgot to add...a file should not be created for the html to be stored. Should one be neccessary(sp?) it should be deleted when it's no longer needed. I am a beginner with VB and a novice programmer so go easy if the answer is obvious. Last edited by mccjg : July 10th, 2003 at 02:10 PM. |
|
#2
|
|||
|
|||
|
damn you for bringing my work home
man, this is all i did last week is set up 5 autogenerated emails, haha, here it is
first I assume you posses the ability to connect to the db all on your own. Secondly, i use cdonts with vbscript, as long as you're not mass mailing it's ok, i hear it's inneficient and should be avoided if you are doing lots of emails with cdonts (hence the name, c donts ![]() code Function EmailCdonts(byval strAuthorEmail,byval strRecipientEmail,ByVal strCC, byval strSubject,byval strBody, ByVal intMailFormat,ByVal strAttachmentPath,ByVal intPriority) Dim ObjMail Set ObjMail = Server.CreateObject("CDONTS.NewMail") ' don't put set if you're using aspx ObjMail.FROM = strAuthorEmail ObjMail.TO = strRecipientEmail ObjMail.Cc = strCC ObjMail.Subject = strSubject ObjMail.BodyFormat = intMailFormat ObjMail.MailFormat = intMailFormat ObjMail.Body = strBody ' CdoHigh = 2 - Highest priority (Urgent) ' CdoNormal = 1 - Normal ' CdoLow = 0 - Lowest ObjMail.Importance = intPriority If strAttachmentPath <> "" Then ObjMail.AttachFile strAttachmentPath End If ObjMail.Send Set ObjMail= Nothing End Function see the bolded strSubject? when you pass this string it, make this your html code, aka all your links will look like this strSubject= "<a href=""http:\\www." & site & ".pdf"">click here to go there</a>" just remember for a " in the string to do "", that one tripped me up alot ![]() Last edited by unatratnag : July 10th, 2003 at 07:32 PM. |
|
#3
|
|||
|
|||
|
oops
sorry, read your email again,
.BodyFormat Format of the message 0=Text (default) 1=HTML you'll want HTML of course Last edited by unatratnag : July 10th, 2003 at 07:32 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Visual Basic Programming > Need to email results of Access query in html |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|