smtp problems in MailMessage

  • Thread starter Lars Grøtteland
  • Start date
L

Lars Grøtteland

Hello!

I was trying to start the mail application that's default in a vb.net asp
page. I used the MailMessage sdk and I have problem with the smtp server. If
I hardcode the smtp - how can the user get their own smtp?

I would like to start outlook express - or what's the default mail program,
with a name in the to field. How?
 
F

Fergus Cooney

Hi Lars,

The following is a very simple routine that starts up the default mail
program using the Shell.

It allows you to specify the Recipient, Sender and Message. The limitation
is that may not include any '?' or '&' characters.

Regards,
Fergus

<code>
Imports System.Diagnostics

Public Sub StartDefaultMailApp (sTo As String, _
Optional sSubject As String = "", _
Optional sMessage As String = "")
Try
Process.Start ("mailto:" & sTo & "?subject=" _
& sSubject & "&body=" & sMessage)

Catch e As Exception
MsgBox ("Couldn't start default email application" _
& vbCrLf & e.Message)
'or
Throw New Exception ("Couldn't start default email application",
e)
End Try
End Sub
</code>
 
C

Cor

Hi Lars,
I was trying to start the mail application that's default in a vb.net asp
page. I used the MailMessage sdk and I have problem with the smtp server. If
I hardcode the smtp - how can the user get their own smtp?

The smtpmail is server side mail.
The user can send a mail using the smtp server on the server.
I would like to start outlook express - or what's the default mail program,
with a name in the to field. How?

When you want him to use the Outlook express or other Mail program on the
default on the client computer, I think the best to do that is on the aspx
html part, either like that is normaly done on a HTML page using the Href
and an image (nice animated gif or something) or with a button and
Javascript.

(You can use a webcontrol button and add the Javascript in the attributes of
that, but that gives I asume unwanted behaviour, I did not test that)

I hope this helps a little bit?
Cor
 

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