I have an ASP.NET web app that I am trying to sens an email from. I use
the code below to send it.
mailMsg := MailMessage.Create;
mailMsg.From := self.Session['SMTPADDRESS'].ToString;
mailMsg.&To := aEMail;
mailMsg.BCC := aAdminEMail;
mailMsg.Subject := 'Your LoginID and Password';
mailMsg.BodyFormat := MailFormat.Text;
mailMsg.Body := 'Your LoginID is '''+aLogin+''' and Password
'''+aPassword+'''';
SmtpMail.SmtpServer := aSMTPServer;
SmtpMail.Send(mailMsg);
My mail server requires password authentication. Where do I assign the
password?
TIAThe following solution is officially unsupported - but it works (you
otherwise need to use CDO or something else to authenticate).
Add these lines to your code before you call SmtpMail.Send()
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthe
nticate",
"1"); //basic authentication
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusern
ame",
myLoginID); //set your username here
mailMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassw
ord",
myPassword); //set your password here
-HTH
"gh" <gh@.at.ne> wrote in message
news:OFCyfZsjFHA.3012@.TK2MSFTNGP12.phx.gbl...
>I have an ASP.NET web app that I am trying to sens an email from. I use
>the code below to send it.
> mailMsg := MailMessage.Create;
> mailMsg.From := self.Session['SMTPADDRESS'].ToString;
> mailMsg.&To := aEMail;
> mailMsg.BCC := aAdminEMail;
> mailMsg.Subject := 'Your LoginID and Password';
> mailMsg.BodyFormat := MailFormat.Text;
> mailMsg.Body := 'Your LoginID is '''+aLogin+''' and Password
> '''+aPassword+'''';
> SmtpMail.SmtpServer := aSMTPServer;
> SmtpMail.Send(mailMsg);
> My mail server requires password authentication. Where do I assign the
> password?
> TIA
Check this out
http://www.systemwebmail.com/faq/3.8.aspx
info@.donotspam dowhileloop.com
http://www.dowhileloop.com -- Website Development
http://publicjoe.dowhileloop.com -- C# & VB.NET Tutorials
"gh" <gh@.at.ne> wrote in message
news:OFCyfZsjFHA.3012@.TK2MSFTNGP12.phx.gbl...
> I have an ASP.NET web app that I am trying to sens an email from. I use
> the code below to send it.
> mailMsg := MailMessage.Create;
> mailMsg.From := self.Session['SMTPADDRESS'].ToString;
> mailMsg.&To := aEMail;
> mailMsg.BCC := aAdminEMail;
> mailMsg.Subject := 'Your LoginID and Password';
> mailMsg.BodyFormat := MailFormat.Text;
> mailMsg.Body := 'Your LoginID is '''+aLogin+''' and Password
> '''+aPassword+'''';
> SmtpMail.SmtpServer := aSMTPServer;
> SmtpMail.Send(mailMsg);
> My mail server requires password authentication. Where do I assign the
> password?
> TIA
Saturday, March 31, 2012
SendingEMail
Labels:
app,
asp,
below,
code,
createmailmsg,
email,
mailmessage,
mailmsg,
net,
sendingemail,
sens,
usethe,
web
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment