2013-08-28 55 views
1

我想從VB6應用程序發送電子郵件,但在發送之前我想打開Outlook或Outlook Express彈出窗口,其中包含從VB6應用程序填充的詳細信息。從vb6.0發送郵件之前顯示Outlook/Outlook Express彈出

我搜索了這個,但它可能與Outlook電子郵件程序。

那麼,如何在發送郵件之前使用默認的郵件發送程序發送郵件並打開郵件發送窗口?

謝謝。

回答

0

有關如何使用mailto API的示例,您可以使用Windows中的mailto:API執行此操作,see here

您的代碼可能是這樣的:

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long 

Sub sendMail() 
    ShellExecute 0, "open", "mailto:[email protected]?body=First Paragraph. %0A%0A Second paragraph. %0A%0A Third Paragraph etc.", 0, 0, 1 
End Sub 
+0

感謝您的答覆。是的,此代碼適用於Outlook和Outlook Express,但存在附件問題。它不會將附件附加到電子郵件。 –

+0

@YoginiMane:我自己並沒有嘗試過,但mailto協議中有一個「附件」參數選項,請參閱此處的註釋:http://msdn.microsoft.com/en-us/library/aa767737(v= vs.85)的.aspx。 – GTG

+0

我試過這個命令,但附件不工作,否則它工作正常。 –

相關問題