Hmmm... Color me skeptical.
How about you start a couple of new projects & feed your mailmessages
more obviously equivalent literals?
Cheers,
-Roy
-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps
and controls [
mailto:DOTNET-WINFORMS@xxxxxxxxxxxxxxxxxxx] On Behalf Of
Roy Forkner
Sent: Thursday, April 29, 2004 8:45 AM
To: DOTNET-WINFORMS@xxxxxxxxxxxxxxxxxxx
Subject: Re: [DOTNET-WINFORMS] MAilmessage difference between vb.net and
c #
I did not write the C# example. A co-worker did and he assures me the to
strings are the same.
Thanks,
Roy
-----Original Message-----
From: Pardee, Roy [
mailto:pardee.r@xxxxxxx]
Sent: Thursday, April 29, 2004 10:35 AM
To: DOTNET-WINFORMS@xxxxxxxxxxxxxxxxxxx
Subject: Re: [DOTNET-WINFORMS] MAilmessage difference between vb.net and
c#
Are these bits really equivalent?
<vb>
sTo = "xxxxx@xxxxxxxxxx"
mailmsg.To = sTo.Trim
</vb>
<c#>
aMessage.To = uc.m_INIStrings[4];
</c#>
What's the error & on what line does it occur?
If you do a MessageBox.Show(mailmsg.To) do you get expected results?
Cheers,
-Roy
-----Original Message-----
From: Discussion forum for developers using Windows Forms to build apps
and controls [
mailto:DOTNET-WINFORMS@xxxxxxxxxxxxxxxxxxx] On Behalf Of
Roy Forkner
Sent: Thursday, April 29, 2004 8:15 AM
To: DOTNET-WINFORMS@xxxxxxxxxxxxxxxxxxx
Subject: [DOTNET-WINFORMS] MAilmessage difference between vb.net and c#
Hi all,
VS2000
VB.Net
If the sTo string has a numeric character in the domain name I get an
error using VB.Net
Why would C# work and VB.Net fail?
TIA,
Roy
sTo = "xxxxx@xxxxxxxxxx"
Dim mailMsg As New MailMessage
With mailMsg
.From = sFrom
.To = sTo.Trim
.Bcc = sBCC
.Cc = sCC
.Subject = sSubject
.Body = sBody
If Not IsNothing(sAttachment) Then
.Attachments.Add(sAttachment)
End If
End With
SmtpMail.Send(mailMsg)
Conversely, using C# I don't get the error. Both apps reference Web.Mail
// send an e-mail to someone that the file already
existed
MailMessage aMessage = new MailMessage();
aMessage.From = "xxxxx@xxxxxxxxxxx";
aMessage.To = uc.m_INIStrings[4];
aMessage.Subject = "Data Entry File was not
processed.";
aMessage.Body = "At: " + DateTime.Now + " The
Data Entry File already existed.";
try
{
SmtpMail.Send(aMessage);
}
catch (Exception ex)
{
string strerror = "";
strerror = ex.Message;
}
Roy Forkner
MIS
972-243-7443
Ext 5171
Thread at a glance:
Previous Message by Date:
click to view message preview
Re: MAilmessage difference between vb.net and c #
The difference in the .To is the C# get the string from an ini file, the
VB.Net is passed a string. What was sent in the body is different but should
have no bearing on the problem.
The C# example has no CC nor BCC. The reason for no CC and no BCC is because
we wanted to see if C# would send to a domain with the 4 in it. IT did send.
Thanks,
Roy
-----Original Message-----
From: Ivan Towlson [mailto:ivan.towlson@xxxxxxxxxxxxxxxx]
Sent: Thursday, April 29, 2004 10:39 AM
To: DOTNET-WINFORMS@xxxxxxxxxxxxxxxxxxx
Subject: Re: [DOTNET-WINFORMS] MAilmessage difference between vb.net and c#
These seem to be significantly different fragments of code. Do you have
a minimal repro case where you are using the same addresses, message
body, attachments etc. in both languages, preferably as literal strings?
--
Ivan Towlson
White Carbon
Next Message by Date:
click to view message preview
make my app sexy and pretty
I have a terrible GUI eye. Thank goodness one of our developers here has a
good GUI eye.
Is there a service, shop, individual, consultant, company out there I can
send screen shots to and they can make recommendations on how to add some
eye candy? I would think this would be a valuable service if they are good.
Greg Robinson
Custom Data Systems, Inc.
www.cds-am.net
Previous Message by Thread:
click to view message preview
Re: MAilmessage difference between vb.net and c #
The difference in the .To is the C# get the string from an ini file, the
VB.Net is passed a string. What was sent in the body is different but should
have no bearing on the problem.
The C# example has no CC nor BCC. The reason for no CC and no BCC is because
we wanted to see if C# would send to a domain with the 4 in it. IT did send.
Thanks,
Roy
-----Original Message-----
From: Ivan Towlson [mailto:ivan.towlson@xxxxxxxxxxxxxxxx]
Sent: Thursday, April 29, 2004 10:39 AM
To: DOTNET-WINFORMS@xxxxxxxxxxxxxxxxxxx
Subject: Re: [DOTNET-WINFORMS] MAilmessage difference between vb.net and c#
These seem to be significantly different fragments of code. Do you have
a minimal repro case where you are using the same addresses, message
body, attachments etc. in both languages, preferably as literal strings?
--
Ivan Towlson
White Carbon
Next Message by Thread:
click to view message preview
MAilmessage difference between vb.net and c #
Ok, I found the problem
In VB I had this line
SmtpMail.SmtpServer = "192.168.30.6"
The C# version did not.
When I dropped the statement from VB it, too, worked.
Funny thing is, it had been working with that statement for 2 months, until
yesterday.
Anyway, that is the solution if anyone has a similar problem.
Thanks,
Roy
Roy Forkner
MIS
972-243-7443
Ext 5171