2016-09-27 23 views
0

どうすればいいか分かります。それは可能ですか?私は、デフォルトのクライアントがロードされる前に、この内部に添付ファイルを追加したいvb.netでデフォルトの電子メールクライアントを使用して添付ファイル付きの電子メールを送信する方法

Try 
    MsgBox("Please wait this may takes time to load", vbInformation, "Mailing System") 
    System.Diagnostics.Process.Start("mailto:" & txtEmailadd.Text) 
Catch ex As Exception 
    MsgBox(ex.Message & " Having some technical difficulties, kindly check if the email textbox has data in it", vbCritical, "System Advisory") 
End Try 

は、ここに私の簡単なコードです。残念ながら、私はウェブで答えを見つけることはありません。アドバイスをいただけますか?事前にありがとうございます。

答えて

0

MailMessage.Attachments()を呼び出す必要があります。ここではサンプルコードです:

Dim MailMsg as New MailMessage 
Dim loAttachment As Attachment = Nothing 
Dim ls_email_attach as String 
Dim server as String 

ls_email_attach = "attach.xls" 
server = "Mail server info" 

//add the attachment 
If Not ls_email_attach.Trim = "" Then 
     loAttachment = New Attachment(ls_email_attach) 
     loMailMsg.Attachments.Add(loAttachment) 
End If 

//send the email 
MailMsg = New SmtpClient(server) 
MailMsg.Send(loMailMsg) 

参照用thisを参照してください。

お手数ですが

+0

こんにちは、お返事ありがとうございます。私はこのことを試してみるつもりです。 –

関連する問題