CDO timestamp

B

BrassicaNigra

I have an application that uses CDO to send an email alert to management when
certain events occur. The messages alway have the wrong time. It appears
the time is UTC. The computer date and time are correct on the machine
running the program (SBS2003R2). How do I get the local time on my email
alerts.
 
S

Steven Cheng [MSFT]

Hi Brassica,

As Mark suggested, for .net/ASP.NET 2.0 application, it is recommended that
we use the Systme.Net.Mail component for SMTP mail processing. Also, for
the datetime issue, I'd like to confirm whether the datetime in the email
is incorrect or just the format (timezone) is incorrect. For example, is
the time in the message still accurate , but not in the correct local time
offset?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 
B

BrassicaNigra

Time is in UTC but is correct. I want it in Mountain Time.

As for System.Net.Mail; I spent several months trying to get this to work
and finally gave up and went back to CDO which I have used for many years.
 
S

Steven Cheng [MSFT]

Thanks for your reply Brassica,

Would you provide me some code snippet of your CDO message sending so that
I can perform some local test on it. BTW, may I also have your current
client operating system's version and some .net framework environment
information?

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
Thread-Topic: CDO timestamp
thread-index: Acj3HzaIiDHYshmfSE6VmiYNHyUlew==
X-WBNR-Posting-Host: 207.46.19.168
From: =?Utf-8?B?QnJhc3NpY2FOaWdyYQ==?= <[email protected]>
References: <[email protected]>
Subject: RE: CDO timestamp
Date: Tue, 5 Aug 2008 10:18:01 -0700
 
B

BrassicaNigra

This is running on Windows Small Business Server 2003R2 under asp.net 2.0

CDO.Message oMsg = new CDO.Message();
CDO.IConfiguration iConfg;
iConfg = oMsg.Configuration;
ADODB.Fields oFields;
oFields = iConfg.Fields;
// Set configuration.
ADODB.Field oField =
oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"];
//TODO: To send by using the smart host, uncomment the
following lines:
oField.Value = CDO.CdoSendUsing.cdoSendUsingPort;
oField =
oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"];
oField.Value = "aaserver";
oFields.Update();
oMsg.From = strSalesRepEmail + "@aapcb.com";
oMsg.To = "(e-mail address removed); (e-mail address removed);
(e-mail address removed)";
oMsg.BCC = "(e-mail address removed)";
oMsg.Subject = "New turnkey order: WO# " +
strGlobalWorkOrder;
oMsg.TextBody = "Hi";
oMsg.Send();
 
S

Steven Cheng [MSFT]

Thanks for your reply Brassica,

I've just performed some research on my local windows 2003 server box. It
seems the email sent via the CDO sys(or the .NET System.net.Mail
componenhts) can display the local time on client machine(the SMTP client),
for me I use outlook. Also, event I change the culture info or timezone at
server, it won't affect the client-side displaying result.

Here is my test code(the CDO code you provided as well as system.net.Mail
code I used):

==============================
private void btnCDO_Click(object sender, EventArgs e)
{
CDO.Message oMsg = new CDO.Message();
CDO.IConfiguration iConfg;
iConfg = oMsg.Configuration;
ADODB.Fields oFields;
oFields = iConfg.Fields;

ADODB.Field oField =
oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"];
oField.Value = CDO.CdoSendUsing.cdoSendUsingPort;

oField =
oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"];
oField.Value = "smtphost";

oField =
oFields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"];
oField.Value = CDO.CdoProtocolsAuthentication.cdoNTLM;


oFields.Update();
oMsg.From = "(e-mail address removed)";
oMsg.To = "(e-mail address removed)";

oMsg.Subject = "New turnkey order: New Email";
oMsg.TextBody = "Hi, this is a test!";
oMsg.Send();
}

private void btnNetSmtp_Click(object sender, EventArgs e)
{
Thread.CurrentThread.CurrentCulture = new
System.Globalization.CultureInfo("de-DE");
MailMessage msg = new MailMessage(
"(e-mail address removed)",
"(e-mail address removed)",
"test email for issue",
"this is a test email!");

SmtpClient client = new SmtpClient("smtphost");
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = true;

client.Send(msg);


}
==================================

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?QnJhc3NpY2FOaWdyYQ==?= <[email protected]>
References: <[email protected]>
<[email protected]>
Subject: RE: CDO timestamp
Date: Thu, 7 Aug 2008 10:53:01 -0700
This is running on Windows Small Business Server 2003R2 under asp.net 2.0

CDO.Message oMsg = new CDO.Message();
CDO.IConfiguration iConfg;
iConfg = oMsg.Configuration;
ADODB.Fields oFields;
oFields = iConfg.Fields;
// Set configuration.
ADODB.Field oField =
oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"];
//TODO: To send by using the smart host, uncomment the
following lines:
oField.Value = CDO.CdoSendUsing.cdoSendUsingPort;
oField =
oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"];
oField.Value = "aaserver";
oFields.Update();
oMsg.From = strSalesRepEmail + "@aapcb.com";
oMsg.To = "(e-mail address removed); (e-mail address removed);
(e-mail address removed)";
oMsg.BCC = "(e-mail address removed)";
oMsg.Subject = "New turnkey order: WO# " +
strGlobalWorkOrder;
oMsg.TextBody = "Hi";
oMsg.Send();


Steven Cheng said:
Thanks for your reply Brassica,

Would you provide me some code snippet of your CDO message sending so that
I can perform some local test on it. BTW, may I also have your current
client operating system's version and some .net framework environment
information?

Sincerely,

Steven Cheng
Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

=>> >>
Subject: CDO timestamp
Date: Mon, 4 Aug 2008 11:44:17 -0700

I have an application that uses CDO to send an email alert to management
when
certain events occur. The messages alway have the wrong time. It appears
the time is UTC. The computer date and time are correct on the machine
running the program (SBS2003R2). How do I get the local time on my email
alerts.
 
S

Steven Cheng [MSFT]

Hi Brassica,

Any progress on this issue?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we

can improve the support we provide to you. Please feel free to let my
manager know what you think of

the level of service provided. You can send feedback directly to my manager
at: (e-mail address removed).

--------------------
From: (e-mail address removed) (Steven Cheng [MSFT])
Organization: Microsoft
Date: Fri, 08 Aug 2008 10:09:09 GMT
Subject: RE: CDO timestamp
Thanks for your reply Brassica,

I've just performed some research on my local windows 2003 server box. It
seems the email sent via the CDO sys(or the .NET System.net.Mail
componenhts) can display the local time on client machine(the SMTP client),
for me I use outlook. Also, event I change the culture info or timezone at
server, it won't affect the client-side displaying result.

Here is my test code(the CDO code you provided as well as system.net.Mail
code I used):

==============================
private void btnCDO_Click(object sender, EventArgs e)
{
CDO.Message oMsg = new CDO.Message();
CDO.IConfiguration iConfg;
iConfg = oMsg.Configuration;
ADODB.Fields oFields;
oFields = iConfg.Fields;

ADODB.Field oField =
oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"];
oField.Value = CDO.CdoSendUsing.cdoSendUsingPort;

oField =
oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"];
oField.Value = "smtphost";

oField =
oFields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"];
oField.Value = CDO.CdoProtocolsAuthentication.cdoNTLM;


oFields.Update();
oMsg.From = "(e-mail address removed)";
oMsg.To = "(e-mail address removed)";

oMsg.Subject = "New turnkey order: New Email";
oMsg.TextBody = "Hi, this is a test!";
oMsg.Send();
}

private void btnNetSmtp_Click(object sender, EventArgs e)
{
Thread.CurrentThread.CurrentCulture = new
System.Globalization.CultureInfo("de-DE");
MailMessage msg = new MailMessage(
"(e-mail address removed)",
"(e-mail address removed)",
"test email for issue",
"this is a test email!");

SmtpClient client = new SmtpClient("smtphost");
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = true;

client.Send(msg);


}
==================================

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#noti f
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 
B

BrassicaNigra

Steven,

No progress yet as I have been out of the office for a few days. I will
look at it again later this week. Thanks for your assistance.

Dale

Steven Cheng said:
Hi Brassica,

Any progress on this issue?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we

can improve the support we provide to you. Please feel free to let my
manager know what you think of

the level of service provided. You can send feedback directly to my manager
at: (e-mail address removed).

--------------------
From: (e-mail address removed) (Steven Cheng [MSFT])
Organization: Microsoft
Date: Fri, 08 Aug 2008 10:09:09 GMT
Subject: RE: CDO timestamp
Thanks for your reply Brassica,

I've just performed some research on my local windows 2003 server box. It
seems the email sent via the CDO sys(or the .NET System.net.Mail
componenhts) can display the local time on client machine(the SMTP client),
for me I use outlook. Also, event I change the culture info or timezone at
server, it won't affect the client-side displaying result.

Here is my test code(the CDO code you provided as well as system.net.Mail
code I used):

==============================
private void btnCDO_Click(object sender, EventArgs e)
{
CDO.Message oMsg = new CDO.Message();
CDO.IConfiguration iConfg;
iConfg = oMsg.Configuration;
ADODB.Fields oFields;
oFields = iConfg.Fields;

ADODB.Field oField =
oFields["http://schemas.microsoft.com/cdo/configuration/sendusing"];
oField.Value = CDO.CdoSendUsing.cdoSendUsingPort;

oField =
oFields["http://schemas.microsoft.com/cdo/configuration/smtpserver"];
oField.Value = "smtphost";

oField =
oFields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"];
oField.Value = CDO.CdoProtocolsAuthentication.cdoNTLM;


oFields.Update();
oMsg.From = "(e-mail address removed)";
oMsg.To = "(e-mail address removed)";

oMsg.Subject = "New turnkey order: New Email";
oMsg.TextBody = "Hi, this is a test!";
oMsg.Send();
}

private void btnNetSmtp_Click(object sender, EventArgs e)
{
Thread.CurrentThread.CurrentCulture = new
System.Globalization.CultureInfo("de-DE");
MailMessage msg = new MailMessage(
"(e-mail address removed)",
"(e-mail address removed)",
"test email for issue",
"this is a test email!");

SmtpClient client = new SmtpClient("smtphost");
client.DeliveryMethod = SmtpDeliveryMethod.Network;
client.UseDefaultCredentials = true;

client.Send(msg);


}
==================================

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#noti f
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top