About

I'm Mike Pope. I live in the Seattle area. I've been a technical writer and editor for over 35 years. I'm interested in software, language, music, movies, books, motorcycles, travel, and ... well, lots of stuff.

Read more ...

Blog Search


(Supports AND)

Feed

Subscribe to the RSS feed for this blog.

See this post for info on full versus truncated feeds.

Quote

Mathematicians, when they work, engage in intensely serious play. They follow their curiosity into problems that interest them and toward the smell of a solution.

Richard Preston



Navigation





<February 2025>
SMTWTFS
2627282930311
2345678
9101112131415
16171819202122
2324252627281
2345678

Categories

  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  
  RSS  

Contact Me

Email me

Blog Statistics

Dates
First entry - 6/27/2003
Most recent entry - 9/4/2024

Totals
Posts - 2655
Comments - 2677
Hits - 2,728,191

Averages
Entries/day - 0.34
Comments/entry - 1.01
Hits/day - 345

Updated every 30 minutes. Last: 10:30 AM Pacific


  01:00 AM

A little preview: at work today, someone noted to me that in .NET 1.1, they added support for CDO fields to my good friend the System.Web.Mail class. The theory is that this will allow us to set/pass values that are not directly exposed via properties on the MailMessage class. The canonical example goes like this:
MailMessage m = new MailMessage(); 
m.From = "..."; // fill in appropriately
m.To = "..."; // fill in appropriately
m.Subject = "Subject";
m.Body= "test " + DateTime.Now.ToString();
m.Fields["http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"] = 1;
m.Fields["http://schemas.microsoft.com/cdo/configuration/sendusername"] = user;
m.Fields["http://schemas.microsoft.com/cdo/configuration/sendpassword"] = password;
SmtpMail.Send(m);
And in fact, mharder had a a post about this on the forums a while back. (Who knew? Not me.)

The example illustrates the solution to a popular question: how to pass authentication credentials with an email message if the server requires logon. I got this working tonight on my local SMTP server. The smtpauthenticate field is set to 1 in the example, which per the CdoProtocolsAuthentication enum indicates Basic. So I set my SMTP server to require Basic auth, turned off anonymous access, and gave it a try. Worked!

According to the docs, you're supposed to be able to set other fields as well. The other one that really interests me is setting the Reply-To field, another question I've been asked. Alas, no luck. I'm trying this:
m.Fields("http://schemas.microsoft.com/cdo/configuration/senduserreplyemailaddress") _
= "Mike Pope <mikepope@myotherdomain.com>"
(In VB, of course.) The field and value are accepted (changing the field name to "foo" throws), and the email gets sent. However, when I grub around in the message details, there's no reply-to info anywhere. So I don't know what CDO is doing with this value that I'm setting.

Well, perhaps that will solve itself.


Update, 1:36am Well, shoot -- thanks to Colt (see comment), we also now have Reply-To figured out. Basically, we now know that the Headers property, which is a simple dictionary, will take any header value (that is, anything documented here). By golly, I've learned two things today, and it's barely past midnight.

[categories]   ,

[9] |