Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MSMapi control
Message
From
14/11/2001 09:44:22
 
 
To
14/11/2001 08:57:30
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00581298
Message ID:
00581450
Views:
78
Jerry,
Assuming your e-mail addresses are stored in an array, you could something like this:
#DEFINE cnRecipientTypeTO     1
#DEFINE cnRecipientTypeCC     2
#DEFINE cnRecipientTypeBCC    3

DIMENSION laRecipients[3, 2]
laRecipients[1, 1] = "James.Bond@spy.com"
laRecipients[1, 2] = cnRecipientTypeTO

laRecipients[2, 1] = "SomeoneElse@email.com"
laRecipients[2, 2] = cnRecipientTypeCC

laRecipients[3, 1] = "SomeoneHidden@somewhere.com"
laRecipients[3, 2] = cnRecipientTypeBCC

WITH this.parent.OleMMess
   .compose
   .msgnotetext = "Message Text"
   .msgsubject  = "Secret Message"

   *-- Create the recipients.
      
   FOR i = 1 TO lnRecipients
     .RecipIndex       = .RecipCount
     .RecipDisplayName = laRecipients[i, 1]
     .RecipType        = laRecipients[i, 2] && To: CC: or BCC:
     .RecipAddress     = ""
     .ResolveName()
   ENDFOR
   
   IF tlShowDialog
     *-- show e-mail message
     this.parent.OleMMess.Send(1)
   ELSE
     *-- unattended mode
     this.parent.OleMMess.Send()
   ENDIF
ENDWITH
>Thanks, that worked great! Another question. How can I send the email to more that 1 person?
>
>The following didn't work. What would be the correct syntax?
>
>.OleMMess.RecipDisplayName = "james.bond@spy.com; someoneelse@email.com"
>
>Thanks,
>
>Jerryt
>
>
>
>>Jerry,
>>Try the following:
>>
>>
>>this.parent.OleMMess.compose
>>this.parent.OleMMess.msgnotetext = "Message Text"
>>this.parent.OleMMess.msgsubject  = "Secret Message"
>>
>>this.parent.OleMMess.RecipDisplayName = "james.bond@spy.com"
>>this.parent.OleMMess.RecipType = 1
>>this.parent.OleMMess.ResolveName()
>>
>>IF tlShowDialog
>>   *-- show e-mail message
>>   this.parent.OleMMess.Send(1)
>>ELSE
>>   *-- unattended mode
>>   this.parent.OleMMess.Send()
>>ENDIF
>>
>>
>>HTH
>>>Using VFP7 and msmapi.mapisession.1 and msmapi.mapimessages.1 activex controls.
>>>
>>>I am following the sample application supplied with VFP7 that demostrates using these controls to send email. The examples work, however, the email message is shown and is asking for an email address before it sends the email.
>>>
>>>How do you specify an email address and how can I avoid see the mail message?
>>>
>>>I want to be able to push a button and have the email sent without any user intervention. What properties do I need to fill in to be able to do this?
>>>
>>>Here's part of what I have so far:
>>>
>>>
>>>this.parent.OleMMess.compose
>>>this.parent.OleMMess.msgnotetext="My message"
>>>this.parent.OleMMess.msgsubject = "My subject"
>>>this.parent.OleMMess.send(1)
>>>
>>>
>>>Thanks,
>>>
>>>Jerryt
Daniel
Previous
Reply
Map
View

Click here to load this message in the networking platform