ערכתי לאחרונה בתאריך 02.01.04 בשעה 10:09 בברכה, eev
דרך אחת היא להשתמש בפקד של אוטלוקדרך שניה היא להתקין SMTPserver שהוא חלק מiis שבא עם מערכות וינדוס 2000 ומעלה . (אבל הוא לא מותקן בברירת המחדל של וינדוס) ואז להשתמש באובייקטים שלו.
אתן לך כאן קוד של הדרך הראשונה למרות שהשניה היא הטובה יותר (ואין לי כח לנמק למה השניה טובה יותר, אבל ניסיתי את שניהם )
Dim OutlObj As Object, NameSpaceObj As Object, EmailObj As Object, AttachmentObj As Object Set OutlObj = CreateObject("Outlook.Application") Set NameSpaceObj = OutlObj.GetNamespace("MAPI") Set EmailObj = OutlObj.CreateItem(0) EmailObj.Subject = "your Subject" EmailObj.To = "[email protected]" Set AttachmentObj = EmailObj.Attachments AttachmentObj.Add "C:\Attachment.doc" ' you can save it in draft EmailObj.Save 'you can Display it to the user EmailObj.Display 'you can send it EmailObj.send
|
בהצלחה