[AccessD] OT: Help with using Redemption to assing an Outlook task.

MartyConnelly martyconnelly at shaw.ca
Sat Oct 30 13:47:58 CDT 2004


Here is another email method. I am not sure of all of the ramifications 
of this method.
Any comments?
I just saw a site where you can purchase one client access to a remote 
Exchange Server
over the net paying by the month. Just to add further email oddities.

'The example code is using CDOSYS (CDO for Windows 2000 or XP).
'I dont think I would want to go back to CDONTS for earlier systems
'It does not depend on MAPI or CDO or Outlook
'It does not use your mailbox to send email.
' So you can send mail without a mail program or mail account
' This code builds the message and drops it into a pickup directory,
' and the SMTP service running on the machine
' picks it up and send it out to the internet.

'So why use CDO code instead of Outlook automation or 
Application.SendMail in VBA.
' It doesn't matter what Mail program you are using (It uses the SMTP 
server).
' It doesn't matter what Office version you are using.
' supposedly you can send an object or file in the body of the mail 
(some mail programs can’t do this)
' haven't verified this
' You can send any file attachment you like.
' No Outlook Security warning so no need for Redemption

' You probably wont have your mail server full expanded smtp address
'If you go into netscape mail or outlook and look for the smtp name
'It will look like mine, "shawmail" or "shawnews" this dns resolves
'to "shawmail.cg.shawcable.net" CDO doesn't resolve this short name so
'The quickest way to get this actual address without using registry et al.
'is run cmd and ping "shawmail" to return full qualified smtp address.
'This code wont run exactly unless you are on cable and signed on in the 
Shaw domain

Sub SendCDO()
' This example use late binding of CDOSys, you don't have to set a reference
' You must be online to net when you run the sub
' You must be running WinXP or Win2000
Dim cdoMessage As Object
Dim objCDOMail As Object
Dim strschema As String
On Error GoTo ErrorHandler ' Enable error-handling routine.
'
Set cdoMessage = CreateObject("CDO.Message")
Set objCDOMail = CreateObject("CDO.Configuration")
strschema = "http://schemas.microsoft.com/cdo/configuration/"
objCDOMail.Load -1 ' CDO Source Default
'If you have illegal or wrong smtp address here it will run for 30-60 
seconds and finally give transport error
With objCDOMail.Fields
.Item(strschema & "sendusing") = 2 ' cdoSendUsingPort
.Item(strschema & "smtpserver") = "shawmail.cg.shawcable.net" ' "Your 
SMTP server address here"
.Item(strschema & "smtpserverport") = 25 'specify port number
.Update
End With

With cdoMessage
Set .Configuration = objCDOMail
.to = "martyconnelly at gmail.com"
.From = "Winnie The Pooh <martyconnelly at shaw.ca>"
.CC = ""
.BCC = ""
.Subject = "This is another test from marty"
.TextBody = "This is the text in the body just cdo defaults"
.AddAttachment "C:\temp2\rptSampleCount.rtf"
.AddAttachment "C:\temp2\frontimage.jpeg"
.send
End With

Set cdoMessage = Nothing
Set objCDOMail = Nothing
Exit Sub ' Exit to avoid handler.
ErrorHandler: ' Error-handling routine.
Debug.Print Err.Number & "-" & Err.Description
Set cdoMessage = Nothing
Set objCDOMail = Nothing
Exit Sub
End Sub




Joe Rojas wrote:

>I am using the code the M&D Manning provided for me.
>
>JR
>
>-----Original Message-----
>From: Charlotte Foust [mailto:cfoust at infostatsystems.com]
>Sent: Friday, October 29, 2004 11:20 AM
>To: Access Developers discussion and problem solving
>Subject: RE: [AccessD] OT: Help with using Redemption to assing an Outlook
>task.
>
>It would be more useful to see the Redemption code you're trying to use.
>You have licensed the Redemption library, right?  There is quite a bit
>of help that comes with it.  Redemption code doesn't use the
>Outlook.Application object like that.  It uses MAPI.Message and
>MAPI.Recipient and MAPI.Session.
>
>Charlotte Foust
>
>
>-----Original Message-----
>From: Joe Rojas [mailto:JRojas at tnco-inc.com]
>Sent: Friday, October 29, 2004 7:47 AM
>To: 'Access Developers discussion and problem solving'
>Subject: [AccessD] OT: Help with using Redemption to assing an Outlook
>task.
>
>
>Hi All,
>
>I am asking this group my question on Redemption because I have seen
>several times when Redemption was offered as a solution for bypassing
>Outlook's e-mail security features.
>
>Below is a function that I am currently using that sends/assigns a task
>the Outlook Object Model only and works perfectly. I want to port this
>code so that it is using Redemption in order to bypass the e-mail
>security features. I have been trying to the past two days and have not
>had any luck.
>
>Can someone please help me with this?
>
>TIA!
>JR
>
>Public Function SendTask()
>   
>    Dim objOutlook As Outlook.Application
>    Dim objOutlookTsk As Outlook.TaskItem
>   
>    Dim strRecipList() As String
>    Dim strNum As String
>    Dim DDueDate As Date
>    Dim strNote As String
>    Dim strBody As String
>    Dim i As Integer
>       
>    strRecipList() = Split(Forms!PrevActions!tbToWhom, ";")
>    strNum = Forms![DMR Form]![tbDMRNum]
>    DDueDate = Forms!PrevActions!tbDueDate
>    strNote = Forms![DMR Form]!tbPartNo
>    strBody = "Part Number: " & strNote & vbCrLf & vbCrLf & _
>    "Discrepency: " & Nz(Forms![DMR Form]![Discrepencies
>subform]!Discrepency, "None Entered") & vbCrLf & vbCrLf & _
>    "Remedial Action: " & Nz(Forms![DMR Form]![Discrepencies
>subform]![Corrective action], "None Entered") & vbCrLf & vbCrLf & _
>    "Corrective Action: " & Nz(Forms![DMR Form]![Discrepencies
>subform]!tbPrevActsub, "None Entered") & vbCrLf & vbCrLf
>   
>   
>    ' Create the Outlook session.
>    Set objOutlook = CreateObject("Outlook.Application")
>
>    ' Create the message.
>    Set objOutlookTsk = objOutlook.CreateItem(olTaskItem)
>
>    With objOutlookTsk
>        ' Add the To recipient(s) to the message.
>        For i = 0 To UBound(strRecipList)
>            objOutlookTsk.Recipients.Add(strRecipList(i)).Type = olTo
>        Next
>               
>        ' Set the Subject, Body, and Importance of the message.
>        .Subject = "Corrective Action for DMR#" & strNum & " - (" &
>strNote & ")"
>        .Body = strBody
>        .Importance = olImportanceHigh  'High importance
>        .ReminderSet = True
>        .ReminderTime = DDueDate - 7
>        .DueDate = DDueDate
>     
>
>        ' Resolve each Recipient's name.
>        For Each objOutlookRecip In .Recipients
>            objOutlookRecip.Resolve
>            If Not objOutlookRecip.Resolve Then
>                objOutlookTsk.Display
>            End If
>        Next
>       
>        .Save
>        .Assign
>        .Send
>       
>    End With
>   Set objOutlookTsk = Nothing
>   Set objOutlook = Nothing
>  
>   MsgBox "Task has been assigned.", , "Task sent"
>
>End Function
>
>
>
>This electronic transmission is strictly confidential to TNCO, Inc. and
>intended solely for the addressee. It may contain information which is
>covered by legal, professional, or other privileges. If you are not the
>intended addressee, or someone authorized by the intended addressee to
>receive transmissions on behalf of the addressee, you must not retain,
>disclose in any form, copy, or take any action in reliance on this
>transmission. If you have received this transmission in error, please
>notify the sender as soon as possible and destroy this message. While
>TNCO, Inc. uses virus protection, the recipient should check this email
>and any attachments for the presence of viruses. TNCO, Inc. accepts no
>liability for any damage caused by any virus transmitted by this email.
>--
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>--
>_______________________________________________
>AccessD mailing list
>AccessD at databaseadvisors.com
>http://databaseadvisors.com/mailman/listinfo/accessd
>Website: http://www.databaseadvisors.com
>
>
>
>This electronic transmission is strictly confidential to TNCO, Inc. and
>intended solely for the addressee. It may contain information which is
>covered by legal, professional, or other privileges. If you are not the
>intended addressee, or someone authorized by the intended addressee to
>receive transmissions on behalf of the addressee, you must not retain,
>disclose in any form, copy, or take any action in reliance on this
>transmission. If you have received this transmission in error, please notify
>the sender as soon as possible and destroy this message. While TNCO, Inc.
>uses virus protection, the recipient should check this email and any
>attachments for the presence of viruses. TNCO, Inc. accepts no liability for
>any damage caused by any virus transmitted by this email.
>  
>

-- 
Marty Connelly
Victoria, B.C.
Canada






More information about the AccessD mailing list