About

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

Read more ...

Blog Search


(Supports AND)

Google Ads

Feed

Subscribe to the RSS feed for this blog.

See this post for info on full versus truncated feeds.

Quote

The usual way in which we plan today for tomorrow is in yesterday's vocabulary.

Edsger W. Dykstra (PDF)



Navigation





<September 2014>
SMTWTFS
31123456
78910111213
14151617181920
21222324252627
2829301234
567891011

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  

Contact

Email me

Blog Statistics

Dates
First entry - 6/27/2003
Most recent entry - 9/6/2014

Totals
Posts - 2306
Comments - 2496
Hits - 1,663,200

Averages
Entries/day - 0.56
Comments/entry - 1.08
Hits/day - 406

Updated every 30 minutes. Last: 4:11 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] |