473,395 Members | 1,458 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

System.Net.Mail

This is some code for VB that is supposed to work in ASP. How come it
doesn't seem to work in ASP?
It is supposed to send mail to an SMTP server that requires a username and
password.
'create the mail message
'Dim mail As New MailMessage()

'set the addresses
'mail.From = New MailAddress("me@mycompany.com")
'mail.To.Add(te***@testdomain.com)

'set the content
'mail.Subject = "TEST TEST TEST This is an email"
'mail.Body = "this is the body content of the email."

'send the message
'Dim smtp As New SmtpClient("127.0.0.1")

'to authenticate we set the username and password properites on the
SmtpClient
'smtp.Credentials = New NetworkCredential("username", "secret")
'smtp.Send(mail)
Aug 29 '06 #1
3 1499

If you work thru my sample project ... at the blog, you'll find the
different switches you need to experiment with to get an "authentication"
email to work.

I have 1.1 and 2.0 syntaxes.

http://sholliday.spaces.live.com/ 2/8/2006

While the code is in C#, you'll at least see the properties you need to set.

You need to find the
TestApp_2_0 . Program.cs file.
Here is what to find ... under the 2/8/2006 entry
You can download the code HERE. (Right-Click and "Save As" works best)

"AbraAbraCadabra" <nw*@gsw-inc.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
This is some code for VB that is supposed to work in ASP. How come it
doesn't seem to work in ASP?
It is supposed to send mail to an SMTP server that requires a username and
password.
'create the mail message
'Dim mail As New MailMessage()

'set the addresses
'mail.From = New MailAddress("me@mycompany.com")
'mail.To.Add(te***@testdomain.com)

'set the content
'mail.Subject = "TEST TEST TEST This is an email"
'mail.Body = "this is the body content of the email."

'send the message
'Dim smtp As New SmtpClient("127.0.0.1")

'to authenticate we set the username and password properites on the
SmtpClient
'smtp.Credentials = New NetworkCredential("username", "secret")
'smtp.Send(mail)


Aug 29 '06 #2
I tried your link on two different computers and they both crash about 10
seconds after viewing the first page. Is there a problem with your link?


"sloan" <sl***@ipass.netwrote in message
news:eQ**************@TK2MSFTNGP03.phx.gbl...
>
If you work thru my sample project ... at the blog, you'll find the
different switches you need to experiment with to get an "authentication"
email to work.

I have 1.1 and 2.0 syntaxes.

http://sholliday.spaces.live.com/ 2/8/2006

While the code is in C#, you'll at least see the properties you need to
set.

You need to find the
TestApp_2_0 . Program.cs file.
Here is what to find ... under the 2/8/2006 entry
You can download the code HERE. (Right-Click and "Save As" works best)

"AbraAbraCadabra" <nw*@gsw-inc.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>This is some code for VB that is supposed to work in ASP. How come it
doesn't seem to work in ASP?
It is supposed to send mail to an SMTP server that requires a username
and
password.
'create the mail message
'Dim mail As New MailMessage()

'set the addresses
'mail.From = New MailAddress("me@mycompany.com")
'mail.To.Add(te***@testdomain.com)

'set the content
'mail.Subject = "TEST TEST TEST This is an email"
'mail.Body = "this is the body content of the email."

'send the message
'Dim smtp As New SmtpClient("127.0.0.1")

'to authenticate we set the username and password properites on the
SmtpClient
'smtp.Credentials = New NetworkCredential("username", "secret")
'smtp.Send(mail)



Aug 30 '06 #3

Use a browser besides IE.

I think microsoft sent an update out for IE.. and it crashes when it goes to
a spaces.msn.com/somebody type site.

They redid the look/feel of the msn spaces.

I get the same issue sometimes.

I thought it was just me, but apparently not.


"AbraAbraCadabra" <nw*@gsw-inc.comwrote in message
news:ev**************@TK2MSFTNGP04.phx.gbl...
I tried your link on two different computers and they both crash about 10
seconds after viewing the first page. Is there a problem with your link?


"sloan" <sl***@ipass.netwrote in message
news:eQ**************@TK2MSFTNGP03.phx.gbl...

If you work thru my sample project ... at the blog, you'll find the
different switches you need to experiment with to get an
"authentication"
email to work.

I have 1.1 and 2.0 syntaxes.

http://sholliday.spaces.live.com/ 2/8/2006

While the code is in C#, you'll at least see the properties you need to
set.

You need to find the
TestApp_2_0 . Program.cs file.
Here is what to find ... under the 2/8/2006 entry
You can download the code HERE. (Right-Click and "Save As" works best)

"AbraAbraCadabra" <nw*@gsw-inc.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
This is some code for VB that is supposed to work in ASP. How come it
doesn't seem to work in ASP?
It is supposed to send mail to an SMTP server that requires a username
and
password.
'create the mail message
'Dim mail As New MailMessage()

'set the addresses
'mail.From = New MailAddress("me@mycompany.com")
'mail.To.Add(te***@testdomain.com)

'set the content
'mail.Subject = "TEST TEST TEST This is an email"
'mail.Body = "this is the body content of the email."

'send the message
'Dim smtp As New SmtpClient("127.0.0.1")

'to authenticate we set the username and password properites on the
SmtpClient
'smtp.Credentials = New NetworkCredential("username", "secret")
'smtp.Send(mail)



Aug 30 '06 #4

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

Similar topics

4
by: Trond A. S. Andersen | last post by:
Hi, all! I'm trying to use the System.Web.Mail. "package" combinded with System.Web.Mail.SmtpMail in order to send MS Excel spreadsheets attached to mail messages. However, sending one single...
3
by: Phil Mc | last post by:
Hi has anyone come accross the problem.... with referance to System.Web.Mail.MailMessage and System.Web.Mail.SmtpMail THIS WORKS FINE mail=new MailMessage(); mail.From =...
5
by: martin | last post by:
Hi, I have created a class that is totally seperate from my web application. However this class is used extensivly by the web application for stuff like data access. I wish to add a function to...
3
by: pmud | last post by:
Hi, I have ab ASP.Net Application in which I need to send e-mail on button click. Even though my C# code for that is correct.I am getting the following error:: I think the following error can be...
1
by: Eric Sheu | last post by:
Greetings, I have been searching the web like mad for a solution to my SMTP problem. I am using Windows Server 2003 and ASP.NET 2.0 w/ C# to send out e-mails from a web site I have created to...
2
by: Ryan | last post by:
Hi, I receive an access denied error (see below) when attempting to send an email with BodyFormat=MailFormat.Html from an asp.net page. Exactly the same code works fine in a console...
1
by: theWizard1 | last post by:
The following sends my email, but the attachment is empty. The attachment should contain the data that is in the string that was created from the xmlReader. I have a stored procedure written...
2
by: clevrmnkey | last post by:
I've had nothing but trouble from the System.Net.Mail objects, but I finally need to make them work, and I can't for the life of me see what I'm doing wrong. I pared back my mail transaction to...
10
by: Frank | last post by:
Hi, I am hoping to find out the differences between the System.Net.Mail and System.Web.Mail. Can some nice folks post the differences; or some urls which show the differences? Great Thanks...
2
by: satnamsarai | last post by:
Using System.Net.Mail: Sometimes I get error 'failure sending mail. Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.' Not sure how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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
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...

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.