473,569 Members | 2,764 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Update on system.net.mail behaviour I think this is important.

Bob
Vs2005 - Framework2. Just to let all of you know. I have found that I can
not use an application to send e-mails using the system,net.mail namespace
while Outlook express is opened on the same machine from which my program is
trying to send an e-mail using smtp mail set to the same smtp server account
as the currently selected outlook mail account. (code snippet follows at
end) the application just does not send e-mail and no exception is
generated.

I started a new thread on this because if what I detected is true it may be
critical to many apps and I want to bring this to your attention.

If this is indeed the case it has some serious implications that warrant
looking into by MS. Say you have a service running that is sending e-mails
of warnings of critical events in certain apps on your computer and it is
configured to use the same smtp account as your outlook. This would mean
that your service would not be sending these notifications if your outlook
is open on the sending computer and there's no way you would know.
Definitely not good behaviour.

Has anyone else noted something similar. If it works Ok for you while
outlook is open what is different in your code from mine?

This is the code being used on a form with just one button to test it. All
it does is send an e-mail from me to myself. The smtp server is not
colocated on my computer but is hosted by a provider outside my LAN. The
smtp service is running on my local host and I have an instance of IIS used
for testing on my local host. I don't know if the above influences anything.
I do know that in Vs2003 when I used system.web.mail to send e-mails I
needed to have IIS running and did not encounter this type of problem. But
since MS deprecated the system.web.mail I thought I'd go with the flow. Not
sure it was a good idea <GGGG>. Anyways, here's the snippet.

Please test it and let me know if you encounter the same situation.
Imports System.net.mail 'before class declaration
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim message As New MailMessage()
Try
message.From = New MailAddress("my ****@mydomain.c om")
message.To.Add( New MailAddress("my ****@mydomain.c om"))
message.Subject = "Test"
message.Body = "Test body"
Dim Client As New SmtpClient()
Client.Host = "mail.mydomain. com"
Client.Port = 25
Dim LoginCredential s As New
System.Net.Netw orkCredential(" my****@mydomain .com", "mypassword ")
Client.UseDefau ltCredentials = False
Client.Credenti als = LoginCredential s
Client.Send(mes sage)
Catch ex As SmtpException
MsgBox(ex.Messa ge)
End Try
End Sub

Thanks to all

Bob


Feb 1 '06 #1
1 1473
Bob
Sorry I said Outlook express, weas mistake. Am using Outlook 2003. Rest all
same
Fingers tired
Bob
"Bob" <bd*****@sgiims .com> wrote in message
news:eV******** *****@TK2MSFTNG P15.phx.gbl...
Vs2005 - Framework2. Just to let all of you know. I have found that I can
not use an application to send e-mails using the system,net.mail namespace
while Outlook express is opened on the same machine from which my program
is trying to send an e-mail using smtp mail set to the same smtp server
account as the currently selected outlook mail account. (code snippet
follows at end) the application just does not send e-mail and no exception
is generated.

I started a new thread on this because if what I detected is true it may
be critical to many apps and I want to bring this to your attention.

If this is indeed the case it has some serious implications that warrant
looking into by MS. Say you have a service running that is sending e-mails
of warnings of critical events in certain apps on your computer and it is
configured to use the same smtp account as your outlook. This would mean
that your service would not be sending these notifications if your outlook
is open on the sending computer and there's no way you would know.
Definitely not good behaviour.

Has anyone else noted something similar. If it works Ok for you while
outlook is open what is different in your code from mine?

This is the code being used on a form with just one button to test it. All
it does is send an e-mail from me to myself. The smtp server is not
colocated on my computer but is hosted by a provider outside my LAN. The
smtp service is running on my local host and I have an instance of IIS
used for testing on my local host. I don't know if the above influences
anything. I do know that in Vs2003 when I used system.web.mail to send
e-mails I needed to have IIS running and did not encounter this type of
problem. But since MS deprecated the system.web.mail I thought I'd go with
the flow. Not sure it was a good idea <GGGG>. Anyways, here's the snippet.

Please test it and let me know if you encounter the same situation.
Imports System.net.mail 'before class declaration
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As
System.EventArg s) Handles Button1.Click
Dim message As New MailMessage()
Try
message.From = New MailAddress("my ****@mydomain.c om")
message.To.Add( New MailAddress("my ****@mydomain.c om"))
message.Subject = "Test"
message.Body = "Test body"
Dim Client As New SmtpClient()
Client.Host = "mail.mydomain. com"
Client.Port = 25
Dim LoginCredential s As New
System.Net.Netw orkCredential(" my****@mydomain .com", "mypassword ")
Client.UseDefau ltCredentials = False
Client.Credenti als = LoginCredential s
Client.Send(mes sage)
Catch ex As SmtpException
MsgBox(ex.Messa ge)
End Try
End Sub

Thanks to all

Bob

Feb 1 '06 #2

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

Similar topics

17
4981
by: kalamos | last post by:
This statement fails update ded_temp a set a.balance = (select sum(b.ln_amt) from ded_temp b where a.cust_no = b.cust_no and a.ded_type_cd = b.ded_type_cd and a.chk_no = b.chk_no group by cust_no, ded_type_cd, chk_no)
7
3240
by: Alex | last post by:
Hi all, I am trying to install a java stored procedure via the windows development centre. The linux box is running 8.1 FP4 as is the windoze platform. If I am on the linux box i can install the sample jdbc stored procedures o.k. For the purpose of this test I created a sample procedure that executes "select * from department" when...
16
3856
by: robert | last post by:
been ruminating on the question (mostly in a 390/v7 context) of whether, and if so when, a row update becomes an insert/delete. i assume that there is a threshold on the number of columns of the table, or perhaps bytes, being updated where the engine just decides, screw it, i'll just make a new one. surfed this group and google, but...
5
1556
by: sugaray | last post by:
Right now, the code I wrote below seems works fine, i know it's definitely not the best solution, so if there are better solutions to eschew from using goto statements to jump out of multiple loops ? and any other suggestions or good ideas that are pertain to construct a more powerful and common interactive menu system is also welcomed, and...
8
1983
by: Will Pittenger | last post by:
I have a Windows program C# .NET solution where when I update its XML documentation, some tags are not recognized and turned into the corresponding HTML. Those tags include <c>, <code>, <para>, <paramref>, and <exception>. <remarks> works; I have not tried <include>. Is this a bug in Studio or am I using those tags incorrectly? When the...
5
3033
by: Alastair Anderson | last post by:
I have created a very simple form with which I would like to update a single value in a single row of a database as a proof of concept. The relevant parts of the form are a DBWebTextBox (which is hooked into a column ORGANISATION.SHORT_NAME) and a Button which I am using as a submit button.
30
3365
by: Charles Law | last post by:
Here's one that should probably have the sub-heading "I'm sure I asked this once before, but ...". Two users are both looking at the same data, from a database. One user changes the data and commits it. How does the other user get the updated view without polling for changes? Is there some sort of callback mechanism that can be set up on...
3
3627
by: J055 | last post by:
Hi I have a PlaceHolder control inside a FormView EditItemTemplate: <asp:PlaceHolder ID="phResponseText" runat="server"> <tr> <td> <asp:Label ID="lblResponseText" runat="server"></asp:Label></td> <td> <asp:TextBox ID="tbResponseText" runat="server" Text='<%#
6
7257
by: | last post by:
Hi, I'm steel trying to read and update my XML file with Visual Basic Express but i am unable to find the right way to read my xml file and update it if neccessary... Here is my problem : evry day, i store the number of children in my classroom in my XML file. For exemple, on monday, my app ask me something like this : msgbox ("Are the...
0
7917
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7665
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6277
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5501
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5217
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3631
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2105
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 we have to send another system
1
1207
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.