How to use my default mail client to mail any file?

G

Guest

Hi all,

I am working on an application, which generate xml files. Now, I want to
send these xml files as attachments to other persons using my default mail
client, like mozilla thunderbird. I want to send these files by just
specifying the mail address of the required person.
 
H

Herfried K. Wagner [MVP]

Dushyant said:
I am working on an application, which generate xml files. Now, I want to
send these xml files as attachments to other persons using my default
mail
client, like mozilla thunderbird. I want to send these files by just
specifying the mail address of the required person.

AFAIK there is no general solution which will work with all mail clients.
However, maybe using .NET's built-in mailing classes to send the mail is an
option (.NET 1.*: 'System.Web.Mail', .NET 2.0: 'System.Net.Mail').
Additional information:

<URL:http://www.systemwebmail.net/>
<URL:http://www.systemnetmail.net/>
 
G

Guest

I tried this way by using System.Web namespace but the problem that I am
facing is that it does not take the mail server address by default. Every
time I have to mention my mail server's address whenever I want to send
mails. Is there anyway, by which it can automatically take mail server's
address.
 
G

Guest

Hi,

I am using WinForms. I am sorry I should have mentioned it earlier. It's a
Windows application.
 
V

vbnetdev

best I could do.....

Dim regKey As RegistryKey
Dim sSmtpServer As String
Try
regKey = Registry.CurrentUser.OpenSubKey _
("Software\Microsoft\Internet Account Manager", False)
Dim sMailAccount As String _
= regKey.GetValue ("Default Mail Account")
regKey.Close()

regKey = Registry.CurrentUser.OpenSubKey _
("Software\Microsoft\Internet Account Manager" _
& "\Accounts\" & sMailAccount, False)
sSmtpServer = regKey.GetValue ("SMTP Server")

Catch ex As Exception
MsgBox(ex.ToString)
Finally
If Not regKey Is Nothing Then _
regKey.Close()
End Try
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top