Saturday, March 31, 2012
SendingEMail
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
SendMail ASP.NET 2.0: Multiple To's
I am trying to send email to 4 people (str01 =
"p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
Dim addrFrom As New MailAddress(str00)
Dim addrTo As New MailAddress(str01)
My problem is that only the first person receives the email. When I check
the variable addrTo the value is "p1.mysite.com". Any help with this would
be appreciated.
--
Thanks in advance,
sck10A mailAddress is used for a single person, the To property of the
MailMessage is actually a collection...
ur supposed to do:
myMessage.To.Add(new MailAddress("email1'))
myMessage.To.Add(new MailAddress("email2'))
myMessage.To.Add(new MailAddress("email3'))
Karl
http://www.openmymind.net/
http://www.fuelindustries.com/
"sck10" <sck10@.online.nospam> wrote in message
news:eyEDvZOWGHA.4924@.TK2MSFTNGP05.phx.gbl...
> Hello,
> I am trying to send email to 4 people (str01 =
> "p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
> Dim addrFrom As New MailAddress(str00)
> Dim addrTo As New MailAddress(str01)
> My problem is that only the first person receives the email. When I check
> the variable addrTo the value is "p1.mysite.com". Any help with this
> would
> be appreciated.
> --
> Thanks in advance,
> sck10
>
Mail recipients can also be added using the cc and bcc attributes.
static void MultipleRecipients()
{
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
//to specify a friendly 'from' name, we use a different ctor
mail.From = new MailAddress("me@.company.com", "Me");
//since the To,Cc, and Bcc accept addresses,
//we can use the same technique as the From address
//since the To, Cc, and Bcc properties are collections,
//to add multiple addreses, we simply call .Add(...) multple times
mail.To.Add("you@.yourcompany.com");
mail.To.Add("you2@.yourcompany.com");
mail.CC.Add("cc1@.yourcompany.com");
mail.CC.Add("cc2@.yourcompany.com");
mail.Bcc.Add("blindcc1@.yourcompany.com");
mail.Bcc.Add("blindcc2@.yourcompany.com");
//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";
//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Karl Seguin [MVP]" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net> wro
te in message
news:eN2MefOWGHA.924@.TK2MSFTNGP03.phx.gbl...
>A mailAddress is used for a single person, the To property of the MailMessa
ge is actually a
>collection...
> ur supposed to do:
> myMessage.To.Add(new MailAddress("email1'))
> myMessage.To.Add(new MailAddress("email2'))
> myMessage.To.Add(new MailAddress("email3'))
> Karl
> --
> http://www.openmymind.net/
> http://www.fuelindustries.com/
>
> "sck10" <sck10@.online.nospam> wrote in message news:eyEDvZOWGHA.4924@.TK2MS
FTNGP05.phx.gbl...
>
OT: Can you retrieve your email address from the smtp web.config?
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uFZL2pOWGHA.752@.TK2MSFTNGP02.phx.gbl...
> Mail recipients can also be added using the cc and bcc attributes.
> static void MultipleRecipients()
> {
> //create the mail message
> MailMessage mail = new MailMessage();
> //set the addresses
> //to specify a friendly 'from' name, we use a different ctor
> mail.From = new MailAddress("me@.company.com", "Me");
> //since the To,Cc, and Bcc accept addresses,
> //we can use the same technique as the From address
> //since the To, Cc, and Bcc properties are collections,
> //to add multiple addreses, we simply call .Add(...) multple times
> mail.To.Add("you@.yourcompany.com");
> mail.To.Add("you2@.yourcompany.com");
> mail.CC.Add("cc1@.yourcompany.com");
> mail.CC.Add("cc2@.yourcompany.com");
> mail.Bcc.Add("blindcc1@.yourcompany.com");
> mail.Bcc.Add("blindcc2@.yourcompany.com");
> //set the content
> mail.Subject = "This is an email";
> mail.Body = "this is the body content of the email.";
> //send the message
> SmtpClient smtp = new SmtpClient("127.0.0.1");
> smtp.Send(mail);
> }
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
> ===================================
> "Karl Seguin [MVP]" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME
> net> wrote in message news:eN2MefOWGHA.924@.TK2MSFTNGP03.phx.gbl...
>
Hello, VickZaro.
The pattern to follow is this one :
<myGroup>
<nestedGroup>
<mySection>
<add key="key_one" value="1"/>
<add key="key_two" value="2"/>
</mySection>
</nestedGroup>
</myGroup>
</configuration>
You can read the value of the configuration section defined in the preceding
example as follows:
Dim config As NameValueCollection=ConfigurationSetting
s.GetConfig("myGroup/n
estedGroup/mySection")
Response.Write("The value of key_one is " & Server.HtmlEncode(config("key_on
e")) & "<br>")
Response.Write("The value of key_two is " & Server.HtmlEncode(config("key_tw
o")) )
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"VickZaro" <VickZaro2112@.hotmail.com> wrote in message
news:LzXYf.94692$6Q2.1609125@.weber.videotron.net...
> OT: Can you retrieve your email address from the smtp web.config?
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:uFZL2pOWGHA.752@.TK2MSFTNGP02.phx.gbl...
>
SendMail ASP.NET 2.0: Multiple Tos
I am trying to send email to 4 people (str01 =
"p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
Dim addrFrom As New MailAddress(str00)
Dim addrTo As New MailAddress(str01)
My problem is that only the first person receives the email. When I check
the variable addrTo the value is "p1.mysite.com". Any help with this would
be appreciated.
--
Thanks in advance,
sck10A mailAddress is used for a single person, the To property of the
MailMessage is actually a collection...
ur supposed to do:
myMessage.To.Add(new MailAddress("email1'))
myMessage.To.Add(new MailAddress("email2'))
myMessage.To.Add(new MailAddress("email3'))
Karl
--
http://www.openmymind.net/
http://www.fuelindustries.com/
"sck10" <sck10@.online.nospam> wrote in message
news:eyEDvZOWGHA.4924@.TK2MSFTNGP05.phx.gbl...
> Hello,
> I am trying to send email to 4 people (str01 =
> "p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
> Dim addrFrom As New MailAddress(str00)
> Dim addrTo As New MailAddress(str01)
> My problem is that only the first person receives the email. When I check
> the variable addrTo the value is "p1.mysite.com". Any help with this
> would
> be appreciated.
> --
> Thanks in advance,
> sck10
Mail recipients can also be added using the cc and bcc attributes.
static void MultipleRecipients()
{
//create the mail message
MailMessage mail = new MailMessage();
//set the addresses
//to specify a friendly 'from' name, we use a different ctor
mail.From = new MailAddress("me@.company.com", "Me");
//since the To,Cc, and Bcc accept addresses,
//we can use the same technique as the From address
//since the To, Cc, and Bcc properties are collections,
//to add multiple addreses, we simply call .Add(...) multple times
mail.To.Add("you@.yourcompany.com");
mail.To.Add("you2@.yourcompany.com");
mail.CC.Add("cc1@.yourcompany.com");
mail.CC.Add("cc2@.yourcompany.com");
mail.Bcc.Add("blindcc1@.yourcompany.com");
mail.Bcc.Add("blindcc2@.yourcompany.com");
//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";
//send the message
SmtpClient smtp = new SmtpClient("127.0.0.1");
smtp.Send(mail);
}
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"Karl Seguin [MVP]" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message
news:eN2MefOWGHA.924@.TK2MSFTNGP03.phx.gbl...
>A mailAddress is used for a single person, the To property of the MailMessage is actually a
>collection...
> ur supposed to do:
> myMessage.To.Add(new MailAddress("email1'))
> myMessage.To.Add(new MailAddress("email2'))
> myMessage.To.Add(new MailAddress("email3'))
> Karl
> --
> http://www.openmymind.net/
> http://www.fuelindustries.com/
>
> "sck10" <sck10@.online.nospam> wrote in message news:eyEDvZOWGHA.4924@.TK2MSFTNGP05.phx.gbl...
>> Hello,
>>
>> I am trying to send email to 4 people (str01 =
>> "p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
>>
>> Dim addrFrom As New MailAddress(str00)
>> Dim addrTo As New MailAddress(str01)
>>
>> My problem is that only the first person receives the email. When I check
>> the variable addrTo the value is "p1.mysite.com". Any help with this would
>> be appreciated.
>> --
>> Thanks in advance,
>>
>> sck10
>>
>>
OT: Can you retrieve your email address from the smtp web.config?
"Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
news:uFZL2pOWGHA.752@.TK2MSFTNGP02.phx.gbl...
> Mail recipients can also be added using the cc and bcc attributes.
> static void MultipleRecipients()
> {
> //create the mail message
> MailMessage mail = new MailMessage();
> //set the addresses
> //to specify a friendly 'from' name, we use a different ctor
> mail.From = new MailAddress("me@.company.com", "Me");
> //since the To,Cc, and Bcc accept addresses,
> //we can use the same technique as the From address
> //since the To, Cc, and Bcc properties are collections,
> //to add multiple addreses, we simply call .Add(...) multple times
> mail.To.Add("you@.yourcompany.com");
> mail.To.Add("you2@.yourcompany.com");
> mail.CC.Add("cc1@.yourcompany.com");
> mail.CC.Add("cc2@.yourcompany.com");
> mail.Bcc.Add("blindcc1@.yourcompany.com");
> mail.Bcc.Add("blindcc2@.yourcompany.com");
> //set the content
> mail.Subject = "This is an email";
> mail.Body = "this is the body content of the email.";
> //send the message
> SmtpClient smtp = new SmtpClient("127.0.0.1");
> smtp.Send(mail);
> }
>
>
> Juan T. Llibre, asp.net MVP
> aspnetfaq.com : http://www.aspnetfaq.com/
> asp.net faq : http://asp.net.do/faq/
> foros de asp.net, en espaol : http://asp.net.do/foros/
> ===================================
> "Karl Seguin [MVP]" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME
> net> wrote in message news:eN2MefOWGHA.924@.TK2MSFTNGP03.phx.gbl...
>>A mailAddress is used for a single person, the To property of the
>>MailMessage is actually a collection...
>>
>> ur supposed to do:
>>
>> myMessage.To.Add(new MailAddress("email1'))
>> myMessage.To.Add(new MailAddress("email2'))
>> myMessage.To.Add(new MailAddress("email3'))
>>
>> Karl
>>
>> --
>> http://www.openmymind.net/
>> http://www.fuelindustries.com/
>>
>>
>> "sck10" <sck10@.online.nospam> wrote in message
>> news:eyEDvZOWGHA.4924@.TK2MSFTNGP05.phx.gbl...
>>> Hello,
>>>
>>> I am trying to send email to 4 people (str01 =
>>> "p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
>>>
>>> Dim addrFrom As New MailAddress(str00)
>>> Dim addrTo As New MailAddress(str01)
>>>
>>> My problem is that only the first person receives the email. When I
>>> check
>>> the variable addrTo the value is "p1.mysite.com". Any help with this
>>> would
>>> be appreciated.
>>> --
>>> Thanks in advance,
>>>
>>> sck10
>>>
>>>
>>
>>
Hello, VickZaro.
The pattern to follow is this one :
<myGroup>
<nestedGroup>
<mySection>
<add key="key_one" value="1"/>
<add key="key_two" value="2"/>
</mySection>
</nestedGroup>
</myGroup>
</configuration
You can read the value of the configuration section defined in the preceding example as follows:
Dim config As NameValueCollection=ConfigurationSettings.GetConfi g("myGroup/nestedGroup/mySection")
Response.Write("The value of key_one is " & Server.HtmlEncode(config("key_one")) & "<br>")
Response.Write("The value of key_two is " & Server.HtmlEncode(config("key_two")) )
Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaol : http://asp.net.do/foros/
===================================
"VickZaro" <VickZaro2112@.hotmail.com> wrote in message
news:LzXYf.94692$6Q2.1609125@.weber.videotron.net.. .
> OT: Can you retrieve your email address from the smtp web.config?
> "Juan T. Llibre" <nomailreplies@.nowhere.com> wrote in message
> news:uFZL2pOWGHA.752@.TK2MSFTNGP02.phx.gbl...
>> Mail recipients can also be added using the cc and bcc attributes.
>>
>> static void MultipleRecipients()
>> {
>> //create the mail message
>> MailMessage mail = new MailMessage();
>>
>> //set the addresses
>> //to specify a friendly 'from' name, we use a different ctor
>> mail.From = new MailAddress("me@.company.com", "Me");
>>
>> //since the To,Cc, and Bcc accept addresses,
>> //we can use the same technique as the From address
>> //since the To, Cc, and Bcc properties are collections,
>> //to add multiple addreses, we simply call .Add(...) multple times
>>
>> mail.To.Add("you@.yourcompany.com");
>> mail.To.Add("you2@.yourcompany.com");
>> mail.CC.Add("cc1@.yourcompany.com");
>> mail.CC.Add("cc2@.yourcompany.com");
>> mail.Bcc.Add("blindcc1@.yourcompany.com");
>> mail.Bcc.Add("blindcc2@.yourcompany.com");
>>
>> //set the content
>> mail.Subject = "This is an email";
>> mail.Body = "this is the body content of the email.";
>>
>> //send the message
>> SmtpClient smtp = new SmtpClient("127.0.0.1");
>> smtp.Send(mail);
>> }
>>
>>
>>
>>
>> Juan T. Llibre, asp.net MVP
>> aspnetfaq.com : http://www.aspnetfaq.com/
>> asp.net faq : http://asp.net.do/faq/
>> foros de asp.net, en espaol : http://asp.net.do/foros/
>> ===================================
>> "Karl Seguin [MVP]" <karl REMOVE @. REMOVE openmymind REMOVEMETOO . ANDME net> wrote in message
>> news:eN2MefOWGHA.924@.TK2MSFTNGP03.phx.gbl...
>>>A mailAddress is used for a single person, the To property of the MailMessage is actually a
>>>collection...
>>>
>>> ur supposed to do:
>>>
>>> myMessage.To.Add(new MailAddress("email1'))
>>> myMessage.To.Add(new MailAddress("email2'))
>>> myMessage.To.Add(new MailAddress("email3'))
>>>
>>> Karl
>>>
>>> --
>>> http://www.openmymind.net/
>>> http://www.fuelindustries.com/
>>>
>>>
>>> "sck10" <sck10@.online.nospam> wrote in message news:eyEDvZOWGHA.4924@.TK2MSFTNGP05.phx.gbl...
>>>> Hello,
>>>>
>>>> I am trying to send email to 4 people (str01 =
>>>> "p1.mysite.com,p2.mysite.com,p3.mysite.com") using the following:
>>>>
>>>> Dim addrFrom As New MailAddress(str00)
>>>> Dim addrTo As New MailAddress(str01)
>>>>
>>>> My problem is that only the first person receives the email. When I check
>>>> the variable addrTo the value is "p1.mysite.com". Any help with this would
>>>> be appreciated.
>>>> --
>>>> Thanks in advance,
>>>>
>>>> sck10
>>>>
>>>>
>>>
>>>
>>
>>
SendMail
SmtpMail.SmtpServer = ConfigurationSettings.AppSettings["smtp_Server_Name"];
string strTo = ConfigurationSettings.AppSettings["contact_To"];
MailMessage msg = new MailMessage();
msg.To = strTo;
msg.From = txtFrom.Text;
msg.Subject = txtSubject.Text;
msg.Body = txtContent.Text;
lblStatus.Text = "Sending...";
SmtpMail.Send(msg);
lblStatus.Text = "Your Message send successfully.";
******************************************
It works great. But it sends email twice to the same address.
I am not sure why it is doing that?
Thanks
Jijo.Um, i got one suggestion and one comment here.
Suggestion:
Make sure your email is only entered once in your web config for ConfigurationSettings.AppSettings["contact_To"];
Comment:
Otherwise it's not a coding problem, as I am having a similar scenario. The code used to work, however i believe there has been changes recently to many servers in schemas against spam and viruses; Ever since those changes about a week (or two) ago the double recieving of emails have started for me, but only in the coding aspect. If i recieve emails from someone else its all fine.
What servers are you on ?
sendmail error
I am trying to send an email to a specified valid email address within my asp.net application
I am using the System.web.mail class.
problem is, when it sending the mail using System.Web.Mail.SmtpMail.Send(theEmailObjectHere) it throws me this exception:
"Exception has been thrown by the target of an invocation"
any ideas?
my smtp server does work (using a web smtp provided by a test email address I have made with that service... and they do support smtp!)
exact error message:
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. --> System.Runtime.InteropServices.COMException (0x8007007F): The specified procedure could not be found. -- End of inner exception stack trace -- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) at System.Web.Mail.LateBoundAccessHelper.SetProp(Type type, Object obj, String propName, Object propKey, Object propValue) at System.Web.Mail.LateBoundAccessHelper.SetPropStatic(Object obj, String propName, Object propKey, Object propValue) at System.Web.Mail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at PFTP.createuser.SendEmailRegisterThanks() in c:\inetpub\wwwroot\pftp\createuser.aspx.cs:line 196anyone?
without seeing any code I am going to take a guess - do you have relaying switched on for the virtual smtp server - its on the Access tab under Relay (i think the default is to only allow relaying from certain Ip addresses and there is nothing fiilled in by default).. just pop the IP address of the webserver into the box
SendUsing configuration value is invalid
Our applications will be created with ASP.NET running on Windows 2003
servers using Framework 1.1
To minimize the administrative effort of configuring developer workstations
and servers, we want developers not to specify a value for
System.Web.Mail.SmtpMail.SmtpServer.
We also have a requirement that on the servers the Application Pools in IIS
run under domain accounts maintained by our Windows Server Administration
group. These accounts are not allowed to be Administrators on the servers.
This domain user has been added to the IIS_WPG group and IIS_WPG has been
added as an operator of the Default SMTP Virtual Server.
Scenarios of sending out emails
1)
- Our user is a non-Administrator
- System.Web.Mail.SmtpMail.SmtpServer = ""
- Result: Error: The "SendUsing" configuration value is invalid.
2)
- Our user is a non-Administrator
- System.Web.Mail.SmtpMail.SmtpServer = "localhost"
- Result: Email is successfully sent.
3)
- We make our user an Administrator (which is not allowed as a solution)
- System.Web.Mail.SmtpMail.SmtpServer = ""
- Result: Email is successfully sent.
We want scenario 1 to work. By the results of scenario 3 it looks like a
permission issue for our non-Admin user. I scoured REGMON and FILEMON findin
g
no hints.
So outside of being an operator for SMTP, what permissions is our user
missing?
Thanks,
fmHi Fm,
From your description, you're using the System.Web.Mail to send mail and
the smtpserver is the local IIS smtp server(on W2K3 IIS6). However you
found that if you specify the SmtpMail.SmtpServer as "localhost", it work
well. If is assigned "", it only works when the asp.net's process identity
is a domain accoutn which has administrator privilege, yes?
Based on this, I've also performed some tests and did find the same
behaviors. I test the same code in Console application,asp.net(with LOCAL
SYSTEM process account) asp.net (default workerprocess account ),
asp.net(with admin domain worker process account). All of them excepet
using the default workprocess work well. So from a general view, this is
likely a permission issue and I'm also not sure the definite permission we
need. Currently I'm consulting some further experts on this behavior and
I'll update you as soon as I've got any update.
Thanks for your understanding.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Steven,
You've produced exactly the problem we are having. I await your findings.
Thanks,
Fm
"Steven Cheng[MSFT]" wrote:
> Hi Fm,
> From your description, you're using the System.Web.Mail to send mail and
> the smtpserver is the local IIS smtp server(on W2K3 IIS6). However you
> found that if you specify the SmtpMail.SmtpServer as "localhost", it work
> well. If is assigned "", it only works when the asp.net's process identit
y
> is a domain accoutn which has administrator privilege, yes?
> Based on this, I've also performed some tests and did find the same
> behaviors. I test the same code in Console application,asp.net(with LOCAL
> SYSTEM process account) asp.net (default workerprocess account ),
> asp.net(with admin domain worker process account). All of them excepet
> using the default workprocess work well. So from a general view, this is
> likely a permission issue and I'm also not sure the definite permission we
> need. Currently I'm consulting some further experts on this behavior and
> I'll update you as soon as I've got any update.
> Thanks for your understanding.
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
Hi Fm,
Sorry for keeping you waiting. After some further consultant, I think the
following information maybe helpful:
http://msdn.microsoft.com/library/d...-us/e2k3/e2k3/_
techsel_tech_1.asp
=========================
Run-Time Permissions
No special permissions are required to run interactive applications or ASP
pages to enable use of CDOSYS. In applications that use the SMTP or NNTP
drop-directory, the application or user must have permission to write into
that directory. When running an application that sends e-mail, the user
will require either write access to the pick-up directory, or read access
to the IIS metabase so the application can determine the SMTP port used for
sending mail.
==========================
So I think when we dont specify an smtpserver (or leave a required field
null), cdo tries to get configuration settings from outlook express or
from metabase. Administrator has access to metabase and thus operation
succeeds. Other users dont so they get sendusing configuration is invalid.
#816789 Read Access to the Everyone Group Is Removed After You Install
Exchange
http://support.microsoft.com/?id=816789
In addition, it is recommended that we always specify the definite
smtpserver names for when calling the System.Web.Mail components or CDO.
Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Sorry it took so long for me to get back to you. We will make it part of our
architecture to have a SMTP server set on the object.
"Steven Cheng[MSFT]" wrote:
> Hi Fm,
> Sorry for keeping you waiting. After some further consultant, I think the
> following information maybe helpful:
> > Exchange
> [url]http://support.microsoft.com/?id=816789" target="_blank">http://msdn.microsoft.com/library/d...com/?id=816789
> In addition, it is recommended that we always specify the definite
> smtpserver names for when calling the System.Web.Mail components or CDO.
> Thanks.
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
>
Hi Fm,
Thanks for your followup.
Good luck!
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
SendUsing configuration value is invalid
Our applications will be created with ASP.NET running on Windows 2003
servers using Framework 1.1
To minimize the administrative effort of configuring developer workstations
and servers, we want developers not to specify a value for
System.Web.Mail.SmtpMail.SmtpServer.
We also have a requirement that on the servers the Application Pools in IIS
run under domain accounts maintained by our Windows Server Administration
group. These accounts are not allowed to be Administrators on the servers.
This domain user has been added to the IIS_WPG group and IIS_WPG has been
added as an operator of the Default SMTP Virtual Server.
Scenarios of sending out emails
1)
- Our user is a non-Administrator
- System.Web.Mail.SmtpMail.SmtpServer = ""
- Result: Error: The "SendUsing" configuration value is invalid.
2)
- Our user is a non-Administrator
- System.Web.Mail.SmtpMail.SmtpServer = "localhost"
- Result: Email is successfully sent.
3)
- We make our user an Administrator (which is not allowed as a solution)
- System.Web.Mail.SmtpMail.SmtpServer = ""
- Result: Email is successfully sent.
We want scenario 1 to work. By the results of scenario 3 it looks like a
permission issue for our non-Admin user. I scoured REGMON and FILEMON finding
no hints.
So outside of being an operator for SMTP, what permissions is our user
missing?
Thanks,
fmHi Fm,
From your description, you're using the System.Web.Mail to send mail and
the smtpserver is the local IIS smtp server(on W2K3 IIS6). However you
found that if you specify the SmtpMail.SmtpServer as "localhost", it work
well. If is assigned "", it only works when the asp.net's process identity
is a domain accoutn which has administrator privilege, yes?
Based on this, I've also performed some tests and did find the same
behaviors. I test the same code in Console application,asp.net(with LOCAL
SYSTEM process account) asp.net (default workerprocess account ),
asp.net(with admin domain worker process account). All of them excepet
using the default workprocess work well. So from a general view, this is
likely a permission issue and I'm also not sure the definite permission we
need. Currently I'm consulting some further experts on this behavior and
I'll update you as soon as I've got any update.
Thanks for your understanding.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Steven,
You've produced exactly the problem we are having. I await your findings.
Thanks,
Fm
"Steven Cheng[MSFT]" wrote:
> Hi Fm,
> From your description, you're using the System.Web.Mail to send mail and
> the smtpserver is the local IIS smtp server(on W2K3 IIS6). However you
> found that if you specify the SmtpMail.SmtpServer as "localhost", it work
> well. If is assigned "", it only works when the asp.net's process identity
> is a domain accoutn which has administrator privilege, yes?
> Based on this, I've also performed some tests and did find the same
> behaviors. I test the same code in Console application,asp.net(with LOCAL
> SYSTEM process account) asp.net (default workerprocess account ),
> asp.net(with admin domain worker process account). All of them excepet
> using the default workprocess work well. So from a general view, this is
> likely a permission issue and I'm also not sure the definite permission we
> need. Currently I'm consulting some further experts on this behavior and
> I'll update you as soon as I've got any update.
> Thanks for your understanding.
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
Hi Fm,
Sorry for keeping you waiting. After some further consultant, I think the
following information maybe helpful:
http://msdn.microsoft.com/library/d...-us/e2k3/e2k3/_
techsel_tech_1.asp
=========================
Run-Time Permissions
No special permissions are required to run interactive applications or ASP
pages to enable use of CDOSYS. In applications that use the SMTP or NNTP
drop-directory, the application or user must have permission to write into
that directory. When running an application that sends e-mail, the user
will require either write access to the pick-up directory, or read access
to the IIS metabase so the application can determine the SMTP port used for
sending mail.
==========================
So I think when we dont specify an smtpserver (or leave a required field
null), cdo tries to get configuration settings from outlook express or
from metabase. Administrator has access to metabase and thus operation
succeeds. Other users dont so they get sendusing configuration is invalid.
#816789 Read Access to the Everyone Group Is Removed After You Install
Exchange
http://support.microsoft.com/?id=816789
In addition, it is recommended that we always specify the definite
smtpserver names for when calling the System.Web.Mail components or CDO.
Thanks.
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Sorry it took so long for me to get back to you. We will make it part of our
architecture to have a SMTP server set on the object.
"Steven Cheng[MSFT]" wrote:
> Hi Fm,
> Sorry for keeping you waiting. After some further consultant, I think the
> following information maybe helpful:
> http://msdn.microsoft.com/library/d...-us/e2k3/e2k3/_
> techsel_tech_1.asp
> =========================
> Run-Time Permissions
> No special permissions are required to run interactive applications or ASP
> pages to enable use of CDOSYS. In applications that use the SMTP or NNTP
> drop-directory, the application or user must have permission to write into
> that directory. When running an application that sends e-mail, the user
> will require either write access to the pick-up directory, or read access
> to the IIS metabase so the application can determine the SMTP port used for
> sending mail.
> ==========================
> So I think when we don?ˉt specify an smtpserver (or leave a required field
> null), cdo tries to get configuration settings from outlook express or
> from metabase. Administrator has access to metabase and thus operation
> succeeds. Other users don?ˉt so they get sendusing configuration is invalid.
> #816789 Read Access to the Everyone Group Is Removed After You Install
> Exchange
> http://support.microsoft.com/?id=816789
> In addition, it is recommended that we always specify the definite
> smtpserver names for when calling the System.Web.Mail components or CDO.
> Thanks.
> Regards,
> Steven Cheng
> Microsoft Online Support
> Get Secure! www.microsoft.com/security
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>
Hi Fm,
Thanks for your followup.
Good luck!
Regards,
Steven Cheng
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Senior Applications Developer Springfield, MA
Save this job | Email this job | Printer-Friendly Version
Location: US-MA-Springfield
Base Pay: $60,000.00 - $80,000.00/Year
Employee Type: Full-Time Employee
Industry: Internet - ECommerce
Manages Others: No
Job Type: Information Technology
Req'd Education: Not Specified
Req'd Experience: More than 5 Years
Req'd Travel: Not Specified
Relocation Covered: No
Contact: Ronella Norris
Phone: 773-527-2414
Must call by 5:00 CST September 30, 2005
DESCRIPTION
Our client is a developer of technologies and applications for the
medical transcription industry. Our principal application is a web
based workflow platform used by more than 100 companies to manage their
transcription business operations. In business since 1990, we have
delivered patented technology and applications to the health care
industry and medical transcription for 15 years.
This candidate would join the IT Department under the Senior
Applications Team and work closely in a team environment in the
development of new applications and technologies and maintenance of the
existing application base under the supervision of the Director of IT.
Work would include development of web applications and services as well
as the development of server side applications. As an example, current
and future development areas of concentration:
Development of Next Gen dictation server applications, incorporating
IVR, speech to text, and TAPI controls for Intel Dialogic telephony
cards
Integration of Speech Recognition Processing and workflow into existing
web application
Development of .NET client/server application utilizing web services
for transcription operations
Conversion of legacy ASP web applications to ASP.NET
REQUIREMENTS
THIS COMPANY IS WILLING TO SPONSOR
A qualified candidate should have 5 to 7 years of experience in
developing web and client/server applications using Microsoft
technologies. Additionally, a Senior Application Developer would be
expected to have experience in the formal software design process,
including functional modeling, technical modeling, UI modeling, and
development process, analysis and strategies.
An in depth understanding of .NET, ASP, SQL, VB, XML/XSLT and web
services is required. A qualified candidate should have a very strong
knowledge of SQL, including query optimization and stored procedures.
The ability to create and work with custom controls is required. A
thorough understanding of Microsoft Office, IIS, VS.NET, and SQL Server
2000 is recommended.
A candidate should be a strong communicator, able to work well with
people regardless of their technical ability. This position will
involve taking on leadership roles for various initiatives and
projects, and thus a qualified individual should be able to keep focus
and achieve business objectives while being able to multitask on daily
operations. Candidates should also be able to effectively mentor and
train others while at the same time demonstrate the ability to develop
and grow their skill set. Should be able to hold self and inspire
others to meet and exceed expectations.Ronella wrote:
> Senior Applications Developer
> Save this job | Email this job | Printer-Friendly Version
> Location: US-MA-Springfield
> Base Pay: $60,000.00 - $80,000.00/Year
> Employee Type: Full-Time Employee
> Industry: Internet - ECommerce
> Manages Others: No
> Job Type: Information Technology
> Req'd Education: Not Specified
> Req'd Experience: More than 5 Years
> Req'd Travel: Not Specified
> Relocation Covered: No
>
>
> Contact: Ronella Norris
> Phone: 773-527-2414
> Must call by 5:00 CST September 30, 2005
>
>
> DESCRIPTION
> Our client is a developer of technologies and applications for the
> medical transcription industry. Our principal application is a web
> based workflow platform used by more than 100 companies to manage their
> transcription business operations. In business since 1990, we have
> delivered patented technology and applications to the health care
> industry and medical transcription for 15 years.
>
> This candidate would join the IT Department under the Senior
> Applications Team and work closely in a team environment in the
> development of new applications and technologies and maintenance of the
> existing application base under the supervision of the Director of IT.
> Work would include development of web applications and services as well
> as the development of server side applications. As an example, current
> and future development areas of concentration:
> Development of Next Gen dictation server applications, incorporating
> IVR, speech to text, and TAPI controls for Intel Dialogic telephony
> cards
> Integration of Speech Recognition Processing and workflow into existing
> web application
> Development of .NET client/server application utilizing web services
> for transcription operations
> Conversion of legacy ASP web applications to ASP.NET
>
> REQUIREMENTS
> THIS COMPANY IS WILLING TO SPONSOR
>
> A qualified candidate should have 5 to 7 years of experience in
> developing web and client/server applications using Microsoft
> technologies. Additionally, a Senior Application Developer would be
> expected to have experience in the formal software design process,
> including functional modeling, technical modeling, UI modeling, and
> development process, analysis and strategies.
> An in depth understanding of .NET, ASP, SQL, VB, XML/XSLT and web
> services is required. A qualified candidate should have a very strong
> knowledge of SQL, including query optimization and stored procedures.
> The ability to create and work with custom controls is required. A
> thorough understanding of Microsoft Office, IIS, VS.NET, and SQL Server
> 2000 is recommended.
> A candidate should be a strong communicator, able to work well with
> people regardless of their technical ability. This position will
> involve taking on leadership roles for various initiatives and
> projects, and thus a qualified individual should be able to keep focus
> and achieve business objectives while being able to multitask on daily
> operations. Candidates should also be able to effectively mentor and
> train others while at the same time demonstrate the ability to develop
> and grow their skill set. Should be able to hold self and inspire
> others to meet and exceed expectations.
>
Please stop spamming the board with Job Postings
thanks
---
If you want religion to be the law of the land, move to Iran
Senior Applications Developer Springfield, MA
Save this job | Email this job | Printer-Friendly Version
Location: US-MA-Springfield
Base Pay: $60,000.00 - $80,000.00/Year
Employee Type: Full-Time Employee
Industry: Internet - ECommerce
Manages Others: No
Job Type: Information Technology
Req'd Education: Not Specified
Req'd Experience: More than 5 Years
Req'd Travel: Not Specified
Relocation Covered: No
Contact: Ronella Norris
Phone: 773-527-2414
Must call by 5:00 CST September 30, 2005
DESCRIPTION
Our client is a developer of technologies and applications for the
medical transcription industry. Our principal application is a web
based workflow platform used by more than 100 companies to manage their
transcription business operations. In business since 1990, we have
delivered patented technology and applications to the health care
industry and medical transcription for 15 years.
This candidate would join the IT Department under the Senior
Applications Team and work closely in a team environment in the
development of new applications and technologies and maintenance of the
existing application base under the supervision of the Director of IT.
Work would include development of web applications and services as well
as the development of server side applications. As an example, current
and future development areas of concentration:
Development of Next Gen dictation server applications, incorporating
IVR, speech to text, and TAPI controls for Intel Dialogic telephony
cards
Integration of Speech Recognition Processing and workflow into existing
web application
Development of .NET client/server application utilizing web services
for transcription operations
Conversion of legacy ASP web applications to ASP.NET
REQUIREMENTS
THIS COMPANY IS WILLING TO SPONSOR
A qualified candidate should have 5 to 7 years of experience in
developing web and client/server applications using Microsoft
technologies. Additionally, a Senior Application Developer would be
expected to have experience in the formal software design process,
including functional modeling, technical modeling, UI modeling, and
development process, analysis and strategies.
An in depth understanding of .NET, ASP, SQL, VB, XML/XSLT and web
services is required. A qualified candidate should have a very strong
knowledge of SQL, including query optimization and stored procedures.
The ability to create and work with custom controls is required. A
thorough understanding of Microsoft Office, IIS, VS.NET, and SQL Server
2000 is recommended.
A candidate should be a strong communicator, able to work well with
people regardless of their technical ability. This position will
involve taking on leadership roles for various initiatives and
projects, and thus a qualified individual should be able to keep focus
and achieve business objectives while being able to multitask on daily
operations. Candidates should also be able to effectively mentor and
train others while at the same time demonstrate the ability to develop
and grow their skill set. Should be able to hold self and inspire
others to meet and exceed expectations.Ronella wrote:
> Senior Applications Developer
> Save this job | Email this job | Printer-Friendly Version
> Location: US-MA-Springfield
> Base Pay: $60,000.00 - $80,000.00/Year
> Employee Type: Full-Time Employee
> Industry: Internet - ECommerce
> Manages Others: No
> Job Type: Information Technology
> Req'd Education: Not Specified
> Req'd Experience: More than 5 Years
> Req'd Travel: Not Specified
> Relocation Covered: No
>
>
> Contact: Ronella Norris
> Phone: 773-527-2414
> Must call by 5:00 CST September 30, 2005
>
>
> DESCRIPTION
> Our client is a developer of technologies and applications for the
> medical transcription industry. Our principal application is a web
> based workflow platform used by more than 100 companies to manage their
> transcription business operations. In business since 1990, we have
> delivered patented technology and applications to the health care
> industry and medical transcription for 15 years.
>
> This candidate would join the IT Department under the Senior
> Applications Team and work closely in a team environment in the
> development of new applications and technologies and maintenance of the
> existing application base under the supervision of the Director of IT.
> Work would include development of web applications and services as well
> as the development of server side applications. As an example, current
> and future development areas of concentration:
> Development of Next Gen dictation server applications, incorporating
> IVR, speech to text, and TAPI controls for Intel Dialogic telephony
> cards
> Integration of Speech Recognition Processing and workflow into existing
> web application
> Development of .NET client/server application utilizing web services
> for transcription operations
> Conversion of legacy ASP web applications to ASP.NET
>
> REQUIREMENTS
> THIS COMPANY IS WILLING TO SPONSOR
>
> A qualified candidate should have 5 to 7 years of experience in
> developing web and client/server applications using Microsoft
> technologies. Additionally, a Senior Application Developer would be
> expected to have experience in the formal software design process,
> including functional modeling, technical modeling, UI modeling, and
> development process, analysis and strategies.
> An in depth understanding of .NET, ASP, SQL, VB, XML/XSLT and web
> services is required. A qualified candidate should have a very strong
> knowledge of SQL, including query optimization and stored procedures.
> The ability to create and work with custom controls is required. A
> thorough understanding of Microsoft Office, IIS, VS.NET, and SQL Server
> 2000 is recommended.
> A candidate should be a strong communicator, able to work well with
> people regardless of their technical ability. This position will
> involve taking on leadership roles for various initiatives and
> projects, and thus a qualified individual should be able to keep focus
> and achieve business objectives while being able to multitask on daily
> operations. Candidates should also be able to effectively mentor and
> train others while at the same time demonstrate the ability to develop
> and grow their skill set. Should be able to hold self and inspire
> others to meet and exceed expectations.
Please stop spamming the board with Job Postings
thanks
--------------
If you want religion to be the law of the land, move to Iran
Saturday, March 24, 2012
Serialize a base class?
A little background, using asp.net 2.0, i'm using a wizard object to create
a email interface for a user to email out their clientele, about 200 or so,
depending on the selection. The first step in the wizard is the email
selection, so it lists all the email accounts and distribution lists the
system has for the user, the user can select lists and/or individuals. I
then read through it all and throw it into an arraylist as a mailaddress
object. The next step in the wizard gives options of whether or not its
displays the selected recipients (including the ones in the lists), format
HTML vs Plain text, BCC the sender, etc. So I loop through all of the
selected emails in my arraylist to display which recipients the user is
emailing to. Here lies my issue.
I need the previously loaded arraylist of selected email addresses to still
be available. The only way i know how to do that is either throw it into a
session variable or the viewstate, both of which requires the class to be
serializable, which MailAddress isn't. I looked into Inheriting and trying
that but I got nowhere fast with that:
<Serializable()> Public Class MailAddress1
Inherits MailAddress
Public Sub New(ByVal email As String, ByVal display As String)
MyBase.New(email, display)
End Sub
End Class
I tried overriding the New sub but it wouldn't let me. So I instead moved
the collecting of email addresses to when the user presses Send. And i do a
lighter collection of the email addresses to a string for displaying their
selected recipients.
SO
I would like to only collect the email addresses once and use the same
arraylist multiple times, on multiple postbacks. Is this possible? I thought
about creating a new class to hold the email address, then transfer them
from my class to the mailaddress class when going to send, but that didnt
make much sens to me to do.
Thanks!!!I think you're stuck with
Create your own Class.
I would write one that had the constructor value needs for the MailAddress
class.
MailAddress (String) Initializes a new instance of the MailAddress
class using the specified address.
MailAddress (String, String) Initializes a new instance of the
MailAddress class using the specified address and display name.
MailAddress (String, String, Encoding)
I'd probably pick the second one.
(Serializable _)
public class MyEMailAddressInfo
property EmailAddress as string
property DisplayName as string
public static (shared in vb.net) GetMailAddress ( e as
MyEMailAddressInfo ) as MailAddress
and then create a collection of these
public class MyEmailAddressInfoCollection : List (Of MyEMailAddressInfo )
( use the inherit keyword instead of the c# ":" of course).
And I'd keep a copy of this object in the Session.
That's what I would do, look for other ideas from others.
Even if that class was serializable, you probably want to keep a "lite"
version of the values (aka the custom collection above) for either Session
or ViewState keeping, because of memory issues.
Keeping around alot of MailAddress objects, just because you need a bunch of
joe@.joes.com values seems non-frugal with the resources
Use the
public static (shared in vb.net) GetMailAddress ( e as MyEMailAddressInfo )
to delay getting those MailAddress objects you need when you actually need
them.
"David Lozzi" <dlozzi@.nospam.nospam> wrote in message
news:8D91BDDA-0C11-425B-8DB3-D1278E4B8C3D@.microsoft.com...
> Howdy,
> A little background, using asp.net 2.0, i'm using a wizard object to
create
> a email interface for a user to email out their clientele, about 200 or
so,
> depending on the selection. The first step in the wizard is the email
> selection, so it lists all the email accounts and distribution lists the
> system has for the user, the user can select lists and/or individuals. I
> then read through it all and throw it into an arraylist as a mailaddress
> object. The next step in the wizard gives options of whether or not its
> displays the selected recipients (including the ones in the lists), format
> HTML vs Plain text, BCC the sender, etc. So I loop through all of the
> selected emails in my arraylist to display which recipients the user is
> emailing to. Here lies my issue.
> I need the previously loaded arraylist of selected email addresses to
still
> be available. The only way i know how to do that is either throw it into a
> session variable or the viewstate, both of which requires the class to be
> serializable, which MailAddress isn't. I looked into Inheriting and trying
> that but I got nowhere fast with that:
> <Serializable()> Public Class MailAddress1
> Inherits MailAddress
> Public Sub New(ByVal email As String, ByVal display As String)
> MyBase.New(email, display)
> End Sub
> End Class
> I tried overriding the New sub but it wouldn't let me. So I instead moved
> the collecting of email addresses to when the user presses Send. And i do
a
> lighter collection of the email addresses to a string for displaying their
> selected recipients.
> SO
> I would like to only collect the email addresses once and use the same
> arraylist multiple times, on multiple postbacks. Is this possible? I
thought
> about creating a new class to hold the email address, then transfer them
> from my class to the mailaddress class when going to send, but that didnt
> make much sens to me to do.
> Thanks!!!
>