???????????????
Sub Command1_Click()
'MAPI constants from CONSTANT.TXT file:
Const SESSION_SIGNON = 1
Const MESSAGE_COMPOSE = 6
Const ATTACHTYPE_DATA = 0
Const RECIPTYPE_TO = 1
Const RECIPTYPE_CC = 2
Const MESSAGE_RESOLVENAME = 13
Const MESSAGE_SEND = 3
Const SESSION_SIGNOFF = 2
'Open up a MAPI session:
MAPISession1.Action = SESSION_SIGNON
'Point the MAPI messages control to the open MAPI session:
MAPIMessages1.SessionID = Form1.MAPISession1.SessionID
MAPIMessages1.Action = MESSAGE_COMPOSE 'Start a new message
'Set the subject of the message:
MAPIMessages1.MsgSubject = "This is the subject."
'Set the message content:
MAPIMessages1.MsgNoteText = "This is the mail message."
'The following four lines of code add an attachment to the message,
'and set the character position within the MsgNoteText where the
'attachment icon will appear. A value of 0 means the attachment will
'replace the first character in the MsgNoteText. You must have at
'least one character in the MsgNoteText to be able to attach a file.
MAPIMessages1.AttachmentPosition = 0
'Set the type of attachment:
MAPIMessages1.AttachmentType = ATTACHTYPE_DATA
'Set the icon title of attachment:
MAPIMessages1.AttachmentName = "System Configuration File"
'Set the path and file name of the attachment:
MAPIMessages1.AttachmentPathName = "C:\CONFIG.SYS"
'Set the recipients
MAPIMessages1.RecipIndex = 0 'First recipient
MAPIMessages1.RecipType = RECIPTYPE_TO 'Recipient in TO line
MAPIMessages1.RecipDisplayName = "EddieSpaghetti" 'e-mail name
MAPIMessages1.RecipIndex = 1 'add a second recipient
MAPIMessages1.RecipType = RECIPTYPE_TO 'Recipient in TO line
MAPIMessages1.RecipDisplayName = "TanyaLasagna" 'e-mail name
MAPIMessages1.RecipIndex = 2 'Add a third recipient
MAPIMessages1.RecipType = RECIPTYPE_CC 'Recipient in CC line
MAPIMessages1.RecipDisplayName = "BlairAngelHair" 'e-mail name
MAPIMessages1.RecipIndex = 3 'Add a fourth recipient
MAPIMessages1.RecipType = RECIPTYPE_CC 'Recipient on CC Line
MAPIMessages1.RecipDisplayName = "JoanieCannelloni" 'e-mail name"
'MESSAGE_RESOLVENAME checks to ensure the recipient is valid and puts
'the recipient address in MapiMessages1.RecipAddress
'If the E-Mail name is not valid, a trappable error will occur.
MAPIMessages1.Action = MESSAGE_RESOLVENAME
'Send the message:
MAPIMessages1.Action = MESSAGE_SEND
'Close MAPI mail session:
MAPISession1.Action = SESSION_SIGNOFF
End Sub
Eric De Decker
vbg.be@vbgroup.nl
Licence And Copy Protection AxtiveX.
Download Demo version on my Site:
Promotions before 02/28/2001 (free source codebook),visite my site