Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1  
Old 06-03-2003, 02:18 AM
davidevery davidevery is online now
Registered User
 
Join Date: 06-03-2003
Location: Sydney Australia
Posts: 16
Question Dynamic Email Attachments

Hi all

I am trying to find a way to add files dynamically into the "Attachments" section of a "Send Mail" item.

So far it appears that you have to hard code the path and filename one line at a time, but I would like to use wildcards or some other way to attach files dynamically at build time.

Would appreciate any assistance on this..

thanks
Reply With Quote
  #2  
Old 06-03-2003, 10:20 AM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
re: Dynamic Email Attachments

Here is a sample (using a Process Files step and a temporary macro) that should achieve what you want. Just replace the file criteria with the files you want to attach, and copy these steps into your build.

Kevin
Attached Files
File Type: bld dynamic email attachments sample.bld (1.2 KB, 2376 views)
Reply With Quote
  #3  
Old 06-03-2003, 03:58 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-20-2003
Location: Dunedin, New Zealand
Posts: 114
A general hint here David, if it is a text field in VBP you can use a macro expansion (macro name inside %%) or script (inside []) to generate its contents. Note too that you can expand macros inside the script, for example to pass parameters to a function call.

This makes VBP extremely powerful as pretty much all option information can be generated at execution time and can come from anywhere.

Peter
Reply With Quote
  #4  
Old 06-03-2003, 07:50 PM
davidevery davidevery is online now
Registered User
 
Join Date: 06-03-2003
Location: Sydney Australia
Posts: 16
Thanks

Excellent help and support, thanks very much for that, it will solve the problem...
Reply With Quote
  #5  
Old 07-25-2003, 08:49 PM
jarrodsinclair jarrodsinclair is online now
Registered User
 
Join Date: 07-25-2003
Location: San Jose, CA (moved from Tucson, AZ in 07/03)
Posts: 5
Send a message via AIM to jarrodsinclair Send a message via Yahoo to jarrodsinclair
Another cool way to send e-mail using CDOSYS objects

here is another way to add attachments and send status of the build when complete:
VBSCRIPT CODE:
' send by connecting to port 25 of the SMTP server
Dim iMsg
Dim iConf
Dim Flds
Dim strHTML
Dim strSmartHost

Const cdoSendUsingPort = 2
StrSmartHost = "exchange"

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
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSmartHost
.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 & "At %DATETIME%, the build of %ProjectName% (%BUILDNUM%) on %COMPUTERNAME% completed successfully.</br>"
strHTML = strHTML & "The Build started at %STARTTIME%.</br>"
strHTML = strHTML & "</BODY>"
strHTML = strHTML & "</HTML>"

' apply the settings to the message
With iMsg
Set .Configuration = iConf
.To = "%DistributionList%"
.From = "person@company.com"
.Subject = "Build Succeeded"
.HTMLBody = strHTML
'you and create a loop here and add as many attachment as you would like
.AddAttachment "C:\Program Files\VisBuildPro\VisBuildPro.log"
.Send
End With

' cleanup of variables
Set iMsg = Nothing
Set iConf = Nothing
Set Flds = Nothing
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 04:23 PM.


Copyright © 1999-2023 Kinook Software, Inc.