SMTP - need help understanding

  • Thread starter Thread starter ZRexRider
  • Start date Start date
Z

ZRexRider

Hi,

I'm successfully sending email using the following code snip but what I
don't understand is the use of "Http://schema" references. What
happens to all email programs that use these references if this site
were to ever go down? Is there a way to hard code the content behind
these addresses? The program I am writing will live as a Windows
Service on a server. Can I be 100% that this server will have access
to this schema address? Just seems weird to me.

Thanks if anybody can better explain.


With objMailMessage

..Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver",
strSMTPAddress)

..Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport",
25)

..Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing",
cdoSendUsingPort)

..Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate",
cdoBasic)

..Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",
strSendUserName)

..Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword",
strSendUserPassword)
.From = strFromAddress
.To = strToAddress
.Bcc = strBccAddress
.Cc = strCcAddress
.Subject = strSubject
.Body = strBody
End With
 
I'm successfully sending email using the following code snip but what I
don't understand is the use of "Http://schema" references. What
happens to all email programs that use these references if this site
were to ever go down? Is there a way to hard code the content behind
these addresses? The program I am writing will live as a Windows
Service on a server. Can I be 100% that this server will have access
to this schema address? Just seems weird to me.

Looks weird to me. This is J# but it works OK and should be almost the same
in VB

================================================
import System.Net.Mail.*;

private void btnSend_Click(Object sender, System.EventArgs e)
{
MailAddress myTo = new MailAddress(toaddress);
MailAddress myFrom = new MailAddress(fromaddress);
MailMessage myMessage = new MailMessage(myFrom, myTo);
myMessage.set_Body("This is the body");
myMessage.set_Subject("This is the subject");
SmtpClient myClient = new SmtpClient("smtp.server.net");
myClient.Send(myMessage);
}
================================================
toaddress and fromaddress should be email addresses in quotes
 
ZRexRider,

The http://schemas.microsoft.com references are namespaces (I think).
It doesn't actually go out to Microsoft's servers and get any
information. It is just a property.

They could have just as easily made the CDO object work the following
way (I'm not sure why they didn't, but there must be a good reason):


objMailMessage.sendUsing(smtpPort, 25)
objMailMessage.send

They must have developed the properties the way they did for
extensability or to conform to some standard.

But in the end, it doesn't use their servers. It is just a constant /
namespace.
 
Seth said:
ZRexRider,

The http://schemas.microsoft.com references are namespaces (I think).
It doesn't actually go out to Microsoft's servers and get any
information. It is just a property.

They could have just as easily made the CDO object work the following
way (I'm not sure why they didn't, but there must be a good reason):


objMailMessage.sendUsing(smtpPort, 25)
objMailMessage.send

They must have developed the properties the way they did for
extensability or to conform to some standard.

But in the end, it doesn't use their servers. It is just a constant /
namespace.

Thanks - that makes sense I guess. I wouldn't have needed these
settings at all except I was unable to find a property that would let
me set user ID and password since authentication is necessary with the
SMTP server Im using

Thanks again
 
Back
Top