473,486 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

SMTPMAIL Format & File Link??

I've built a form that I want to use to email some of the information off it
to a few users which will include a link to a folder on our network. I'm
trying to send it in html format but when the message is received all you
see is the html code and not just the text. I've included the code below
but I'm a rookie so I must be missing something or doing something wrong.
Thanks!

Barclay

Sub sendmail()

Dim email As MailMessage = New MailMessage

Dim stringMessage As String

Dim uName As String

uName = "us**@domain.com"

'message string with link

'stringMessage = "<BODY>Click the link below to open directory<A
href=""file://z:\pending move\" & TextBox1.Text & "\"">file://z:\pending
move\& textbox1.text & ""\</A> </BODY>"

stringMessage = "<html><body>UtilMailMessage001->success</body></html>"

email.BodyFormat = MailFormat.Html

SmtpMail.SmtpServer = "mail.domain.net"

SmtpMail.Send(uName, "us**@domain.com", "New Files Ready to be Archived in
folder: (" & TextBox1.Text & ")", stringMessage)

End Sub
Nov 20 '05 #1
1 1461
Thanks for the help, I had some of my quotes screwed up.

"Jenni Parks" <Jenni Pa***@discussions.microsoft.com> wrote in message
news:DE**********************************@microsof t.com...
Try this:

Dim newMail As New MailMessage

newMail.From = MailFrom
newMail.To = MailTo
newMail.Subject = Subject
newMail.BodyFormat = MailFormat.Html
newMail.Body = "<html><head><title>" & Subject & "</title></head><body>" & Message & "</body></html>" SmtpMail.Send(newMail)

Also make sure the mail server you are sending through and the destination mail server support html email.
Best Regards,

Jennifer M.G. Parks

Application Dev & Sr Tech Support
Activehost Corporation
Web site: http://www.activehost.com
Technical Support: http://www.activehost.com/support
(518) 372.2842 x230
(518) 372.5349 fax

Considering Activehost? Read what our customers have to say about us.
http://www.actionjackson.com/hosts/h....asp?HostID=27
"B-Dog" wrote:
I've built a form that I want to use to email some of the information off it to a few users which will include a link to a folder on our network. I'm trying to send it in html format but when the message is received all you see is the html code and not just the text. I've included the code below but I'm a rookie so I must be missing something or doing something wrong. Thanks!

Barclay

Sub sendmail()

Dim email As MailMessage = New MailMessage

Dim stringMessage As String

Dim uName As String

uName = "us**@domain.com"

'message string with link

'stringMessage = "<BODY>Click the link below to open directory<A
href=""file://z:\pending move\" & TextBox1.Text & "\"">file://z:\pending
move\& textbox1.text & ""\</A> </BODY>"

stringMessage = "<html><body>UtilMailMessage001->success</body></html>"

email.BodyFormat = MailFormat.Html

SmtpMail.SmtpServer = "mail.domain.net"

SmtpMail.Send(uName, "us**@domain.com", "New Files Ready to be Archived in folder: (" & TextBox1.Text & ")", stringMessage)

End Sub

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5036
by: Ed Sutton | last post by:
How can I show the email client UI so the user can send the attachment to the desired recipient. I get an exception if I leave the MailMessage.To property blank. Is there any way to do this? I...
7
3793
by: Jason | last post by:
Hi just a really quick simple question. Can you configure SmtpMail class in C# to use a different port? or does it have to be port 25? Thanks Jason
9
3846
by: Kevin Spencer | last post by:
We just moved an ASP.Net app to a Windows 2003 Server, and the SMTPMail fails now with the following message: System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr,...
5
2129
by: ElanKathir | last post by:
Hi ! I wrote one code for Send the E-mail, But that code have some problem , So please help me Here i paste my code and Error: Error: Server Error in '/Elan_Sample' Application. ...
1
2421
by: Michael | last post by:
Hello, I've read a lot of threads on this subject, but they typically go back to a problem with the smtp server configuration. In my case, everything works great until I uncomment the one line...
2
1221
by: Arthur Carré | last post by:
Hi everyone. I have i big problem with the SmtpMail class of visual studio ..NET 2003. Here it is : I'm sending mail with attachment (1 or more) and if there is an exception after contacting...
9
1829
by: Russell Stevens | last post by:
I generate pdf files on my server and allow users to access them via a browser and also email them. Most files work fine whether the user uses his browser or gets an email with a pdf attachment...
19
3349
by: zdrakec | last post by:
Hello all: Using an "Imports System.Web.Mail" clause at the head of my module, and after executing the following code: Dim msg As New MailMessage msg.From = sender msg.To = recipient...
2
2786
by: joseph2000 | last post by:
Hi, I have problem with e-mails which are being send via System.Web.Mail.SmtpMail class but before describing the problem itself first I'd like to show shortly what I'm doing on the server. ...
0
7099
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7123
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6842
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7319
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1378
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.