Create Mailitem with CDO (set from Address )

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hello,

i want to create a mailitem in den inbox Folder with cdo.

my code:

Set objCDO = Application.CreateObject("MAPI.Session")

objCDO.Logon "", "", False, False, 0

Set objMessage = objCDO.inbox.messages.Add

objMessage.timereceived = "01.01.2000"

objMessage.timesent = "01.10.2001"

objMessage.Text = "TEST1234"

objMessage.Subject = "Betreff"

Set oRecips = objMessage.Recipients

Set oRecip = oRecips.Add("test1@xxxxxxxx", , MAPI.CdoRecipientType.cdoTo)

Set oRecip = oRecips.Add("test2@xxxxxxxx", , MAPI.CdoRecipientType.cdoTo)

oRecips.Resolve (True)

objMessage.UnRead = True

objMessage.Update



my problem is to define the from Address.

Please help me

Thanks

Waldemar


Relevant Pages

  • RE: Email Individual Records within a Report / Query
    ... For this you can automate your task either by using Outlook or CDO. ... Set objMessage = CreateObject ... In order to CDO to work, your machine should be installed with IIS SMTP ... Add/Remove Windows Components button. ...
    (microsoft.public.access.reports)
  • Re: Email with MS Access and CDO: showdialog before sending
    ... Set objMessage = CreateObject ... objMessage.TextBody = "This is some sample message text." ... Typically CDO does not interact directly with Outlook or your default e- ...
    (comp.databases.ms-access)
  • Re: save web page and send as mail
    ... Is CDO an option? ... >I am trying to create a vbs file that will get the contains of a web page ... > Dim xml,objCDO ... > Set objCDO = Nothing ...
    (microsoft.public.scripting.vbscript)
  • CDO and "Line too long" returned email
    ... Occationally the emails bounce with this error: "500 5.5.0 Syntax ... Can I get CDO to handle ... Set objMessage = New CDO.message ...
    (microsoft.public.exchange.development)
  • CDO not sending to internal domain
    ... I have tried using both CDO and CDONTS in VBScript on an ASP page to ... Set objCDO = Server.CreateObject ...
    (microsoft.public.scripting.vbscript)