C
Chuck Farah
i heard from our it folks that you cannot use the
outlook.application named space to email. i.e. the
following will never work, get security errors or nothing
at all happens.
Sub SendAttach()
'Open mail, adress, attach report
Dim objOutlk 'Outlook
Dim objMail 'Email item
Dim strMsg
Const olMailItem = 0
'Create a new message
objOutlk = CreateObject("Outlook.Application")
objMail = objOutlk.createitem(olMailItem)
objMail.To = "(e-mail address removed)"
objMail.cc = "" 'Enter an address here To include
a carbon copy; bcc is For blind carbon copy's
'Set up Subject Line
objMail.subject = "I saw your code On Planet
Source Code on " & CStr(month(now)) & "/" & CStr(day
(now)) & "/" & CStr(year(now))
'Add the body
strMsg = "Your code rocks!" & vbcrlf
strMsg = strMsg & "I voted and gave you an
excellent rating!"
'To add an attachment, use:
'objMail.attachments.add
("C:\MyAttachmentFile.txt")
objMail.body = strMsg
objMail.display() 'Use this To display before
sending, otherwise call objMail.Send to send without
reviewing
'Clean up
objMail = Nothing
objOutlk = Nothing
End Sub
If its possible i may need help just to get this silly
thing to work, ie do i have to do some security
changes,register things on my server etc..etc..,
run this on my pc (local iis) which is XP and of course
has the outlook client
(BTW using windows forms this works fine!)
outlook.application named space to email. i.e. the
following will never work, get security errors or nothing
at all happens.
Sub SendAttach()
'Open mail, adress, attach report
Dim objOutlk 'Outlook
Dim objMail 'Email item
Dim strMsg
Const olMailItem = 0
'Create a new message
objOutlk = CreateObject("Outlook.Application")
objMail = objOutlk.createitem(olMailItem)
objMail.To = "(e-mail address removed)"
objMail.cc = "" 'Enter an address here To include
a carbon copy; bcc is For blind carbon copy's
'Set up Subject Line
objMail.subject = "I saw your code On Planet
Source Code on " & CStr(month(now)) & "/" & CStr(day
(now)) & "/" & CStr(year(now))
'Add the body
strMsg = "Your code rocks!" & vbcrlf
strMsg = strMsg & "I voted and gave you an
excellent rating!"
'To add an attachment, use:
'objMail.attachments.add
("C:\MyAttachmentFile.txt")
objMail.body = strMsg
objMail.display() 'Use this To display before
sending, otherwise call objMail.Send to send without
reviewing
'Clean up
objMail = Nothing
objOutlk = Nothing
End Sub
If its possible i may need help just to get this silly
thing to work, ie do i have to do some security
changes,register things on my server etc..etc..,
run this on my pc (local iis) which is XP and of course
has the outlook client
(BTW using windows forms this works fine!)