Home All Groups Group Topic Archive Search About

question about sending email

Author
4 Jul 2006 9:04 AM
Crespo
hi,every one! I have a question about sending emails.My codes works well
over some smtp servers,but doesn't over the others. My codes is listed
belowed:
    try
   {
     MailMessage mailObj = new MailMessage();
     mailObj.To.Add(receipientAddr);
     mailObj.From = new MailAddress(senderAddr);

     mailObj.Subject = "very good";
     mailObj.Body = "thank you";

     mailObj.IsBodyHtml = true;
     mailObj.Priority = MailPriority.High;
     mailObj.BodyEncoding = System.Text.Encoding.UTF8;


    System.Net.Mail.SmtpClient client = new
System.Net.Mail.SmtpClient(smtpServerIP);
    client.UseDefaultCredentials = false;
    mailObj.SubjectEncoding = System.Text.Encoding.UTF8;
    client.Credentials = new
System.Net.NetworkCredential(this.tb_mailUserName.Text,
this.tb_mailUserPassword.Text);
    client.DeliveryMethod = SmtpDeliveryMethod.Network;
     client.Send(mailObj);

   }
   catch(Exception ex)
   {
     MessageBox.Show(ex.Message.ToString());
     return;
   }

   when smtpServerIP is specified with some smtp server ips, the mail can be
delievered correctly.But over some smtp servers such as "smtp.21cn.com",the
codes didn't throw any exception and seemed to have work well,but when I
logined mail.21cn.com,I could not  find the expectedly incoming mail. Could
anyone help me?

Crespo
2006-07-03

Author
4 Jul 2006 6:17 PM
Greg Young
It could be that the mail is getting caught by a filter somewhere.

A perfect example of this would be that some servers do a reverse lookup. If
the IP address you are sending from does not matchup one of the MX records
defined for the domain you are sending from they will not deliver it.

One thing that may help would be to save the conversation ...
http://www.systemnetmail.com/faq/4.10.aspx includes info on how to log the
conversation.


Cheers,

Greg Young
MVP - C#
http://codebetter.com/blogs/gregyoung

Show quote
"Crespo" <wuhua***@21cn.com> wrote in message
news:upOlup0nGHA.1332@TK2MSFTNGP05.phx.gbl...
> hi,every one! I have a question about sending emails.My codes works well
> over some smtp servers,but doesn't over the others. My codes is listed
> belowed:
>    try
>   {
>     MailMessage mailObj = new MailMessage();
>     mailObj.To.Add(receipientAddr);
>     mailObj.From = new MailAddress(senderAddr);
>
>     mailObj.Subject = "very good";
>     mailObj.Body = "thank you";
>
>     mailObj.IsBodyHtml = true;
>     mailObj.Priority = MailPriority.High;
>     mailObj.BodyEncoding = System.Text.Encoding.UTF8;
>
>
>    System.Net.Mail.SmtpClient client = new
> System.Net.Mail.SmtpClient(smtpServerIP);
>    client.UseDefaultCredentials = false;
>    mailObj.SubjectEncoding = System.Text.Encoding.UTF8;
>    client.Credentials = new
> System.Net.NetworkCredential(this.tb_mailUserName.Text,
> this.tb_mailUserPassword.Text);
>    client.DeliveryMethod = SmtpDeliveryMethod.Network;
>     client.Send(mailObj);
>
>   }
>   catch(Exception ex)
>   {
>     MessageBox.Show(ex.Message.ToString());
>     return;
>   }
>
>   when smtpServerIP is specified with some smtp server ips, the mail can
> be
> delievered correctly.But over some smtp servers such as
> "smtp.21cn.com",the
> codes didn't throw any exception and seemed to have work well,but when I
> logined mail.21cn.com,I could not  find the expectedly incoming mail.
> Could
> anyone help me?
>
> Crespo
> 2006-07-03
>
>
>
Author
5 Jul 2006 10:07 AM
Crespo
thank Gred Young very much. But I don't understand well,could you give more
detail.Thanks very much.

Crespo


Show quote
"Greg Young" <druckdruckREMOVEgo***@hotmail.com> дÈëÏûÏ¢
news:emA8sY5nGHA.1208@TK2MSFTNGP04.phx.gbl...
> It could be that the mail is getting caught by a filter somewhere.
>
> A perfect example of this would be that some servers do a reverse lookup.
If
> the IP address you are sending from does not matchup one of the MX records
> defined for the domain you are sending from they will not deliver it.
>
> One thing that may help would be to save the conversation ...
> http://www.systemnetmail.com/faq/4.10.aspx includes info on how to log the
> conversation.
>
>
> Cheers,
>
> Greg Young
> MVP - C#
> http://codebetter.com/blogs/gregyoung
>
> "Crespo" <wuhua***@21cn.com> wrote in message
> news:upOlup0nGHA.1332@TK2MSFTNGP05.phx.gbl...
> > hi,every one! I have a question about sending emails.My codes works well
> > over some smtp servers,but doesn't over the others. My codes is listed
> > belowed:
> >    try
> >   {
> >     MailMessage mailObj = new MailMessage();
> >     mailObj.To.Add(receipientAddr);
> >     mailObj.From = new MailAddress(senderAddr);
> >
> >     mailObj.Subject = "very good";
> >     mailObj.Body = "thank you";
> >
> >     mailObj.IsBodyHtml = true;
> >     mailObj.Priority = MailPriority.High;
> >     mailObj.BodyEncoding = System.Text.Encoding.UTF8;
> >
> >
> >    System.Net.Mail.SmtpClient client = new
> > System.Net.Mail.SmtpClient(smtpServerIP);
> >    client.UseDefaultCredentials = false;
> >    mailObj.SubjectEncoding = System.Text.Encoding.UTF8;
> >    client.Credentials = new
> > System.Net.NetworkCredential(this.tb_mailUserName.Text,
> > this.tb_mailUserPassword.Text);
> >    client.DeliveryMethod = SmtpDeliveryMethod.Network;
> >     client.Send(mailObj);
> >
> >   }
> >   catch(Exception ex)
> >   {
> >     MessageBox.Show(ex.Message.ToString());
> >     return;
> >   }
> >
> >   when smtpServerIP is specified with some smtp server ips, the mail can
> > be
> > delievered correctly.But over some smtp servers such as
> > "smtp.21cn.com",the
> > codes didn't throw any exception and seemed to have work well,but when I
> > logined mail.21cn.com,I could not  find the expectedly incoming mail.
> > Could
> > anyone help me?
> >
> > Crespo
> > 2006-07-03
> >
> >
> >
>
>
Author
7 Jul 2006 9:59 AM
Greg Young
What part are you not understanding? Can you get the conversation between
your client and the SMTP server (directions in link).

Cheers,

Greg
Show quote
"Crespo" <wuhua***@21cn.com> wrote in message
news:%23RV1drBoGHA.4000@TK2MSFTNGP04.phx.gbl...
> thank Gred Young very much. But I don't understand well,could you give
> more
> detail.Thanks very much.
>
> Crespo
>
>
> "Greg Young" <druckdruckREMOVEgo***@hotmail.com> дÈëÏûÏ¢
> news:emA8sY5nGHA.1208@TK2MSFTNGP04.phx.gbl...
>> It could be that the mail is getting caught by a filter somewhere.
>>
>> A perfect example of this would be that some servers do a reverse lookup.
> If
>> the IP address you are sending from does not matchup one of the MX
>> records
>> defined for the domain you are sending from they will not deliver it.
>>
>> One thing that may help would be to save the conversation ...
>> http://www.systemnetmail.com/faq/4.10.aspx includes info on how to log
>> the
>> conversation.
>>
>>
>> Cheers,
>>
>> Greg Young
>> MVP - C#
>> http://codebetter.com/blogs/gregyoung
>>
>> "Crespo" <wuhua***@21cn.com> wrote in message
>> news:upOlup0nGHA.1332@TK2MSFTNGP05.phx.gbl...
>> > hi,every one! I have a question about sending emails.My codes works
>> > well
>> > over some smtp servers,but doesn't over the others. My codes is listed
>> > belowed:
>> >    try
>> >   {
>> >     MailMessage mailObj = new MailMessage();
>> >     mailObj.To.Add(receipientAddr);
>> >     mailObj.From = new MailAddress(senderAddr);
>> >
>> >     mailObj.Subject = "very good";
>> >     mailObj.Body = "thank you";
>> >
>> >     mailObj.IsBodyHtml = true;
>> >     mailObj.Priority = MailPriority.High;
>> >     mailObj.BodyEncoding = System.Text.Encoding.UTF8;
>> >
>> >
>> >    System.Net.Mail.SmtpClient client = new
>> > System.Net.Mail.SmtpClient(smtpServerIP);
>> >    client.UseDefaultCredentials = false;
>> >    mailObj.SubjectEncoding = System.Text.Encoding.UTF8;
>> >    client.Credentials = new
>> > System.Net.NetworkCredential(this.tb_mailUserName.Text,
>> > this.tb_mailUserPassword.Text);
>> >    client.DeliveryMethod = SmtpDeliveryMethod.Network;
>> >     client.Send(mailObj);
>> >
>> >   }
>> >   catch(Exception ex)
>> >   {
>> >     MessageBox.Show(ex.Message.ToString());
>> >     return;
>> >   }
>> >
>> >   when smtpServerIP is specified with some smtp server ips, the mail
>> > can
>> > be
>> > delievered correctly.But over some smtp servers such as
>> > "smtp.21cn.com",the
>> > codes didn't throw any exception and seemed to have work well,but when
>> > I
>> > logined mail.21cn.com,I could not  find the expectedly incoming mail.
>> > Could
>> > anyone help me?
>> >
>> > Crespo
>> > 2006-07-03
>> >
>> >
>> >
>>
>>
>
>
Author
4 Jul 2006 11:27 PM
Göran_Andersson
Many ISPs have closed the port used by SMTP, so that you can only send
mail using their mail server, to prevent spamming.

Crespo wrote:
Show quote
> hi,every one! I have a question about sending emails.My codes works well
> over some smtp servers,but doesn't over the others. My codes is listed
> belowed:
>     try
>    {
>      MailMessage mailObj = new MailMessage();
>      mailObj.To.Add(receipientAddr);
>      mailObj.From = new MailAddress(senderAddr);
>
>      mailObj.Subject = "very good";
>      mailObj.Body = "thank you";
>
>      mailObj.IsBodyHtml = true;
>      mailObj.Priority = MailPriority.High;
>      mailObj.BodyEncoding = System.Text.Encoding.UTF8;
>
>
>     System.Net.Mail.SmtpClient client = new
> System.Net.Mail.SmtpClient(smtpServerIP);
>     client.UseDefaultCredentials = false;
>     mailObj.SubjectEncoding = System.Text.Encoding.UTF8;
>     client.Credentials = new
> System.Net.NetworkCredential(this.tb_mailUserName.Text,
> this.tb_mailUserPassword.Text);
>     client.DeliveryMethod = SmtpDeliveryMethod.Network;
>      client.Send(mailObj);
>
>    }
>    catch(Exception ex)
>    {
>      MessageBox.Show(ex.Message.ToString());
>      return;
>    }
>
>    when smtpServerIP is specified with some smtp server ips, the mail can be
> delievered correctly.But over some smtp servers such as "smtp.21cn.com",the
> codes didn't throw any exception and seemed to have work well,but when I
> logined mail.21cn.com,I could not  find the expectedly incoming mail. Could
> anyone help me?
>
> Crespo
> 2006-07-03
>
>
>
Author
5 Jul 2006 10:06 AM
Crespo
Thank you,Mr Andersson. I don't understand well what you explained,could you
give me more detail? Thank you very much.

  Crespo

Show quote
"Göran Andersson" <gu***@guffa.com> ????
news:uEid5F8nGHA.4364@TK2MSFTNGP05.phx.gbl...
> Many ISPs have closed the port used by SMTP, so that you can only send
> mail using their mail server, to prevent spamming.
>
> Crespo wrote:
> > hi,every one! I have a question about sending emails.My codes works well
> > over some smtp servers,but doesn't over the others. My codes is listed
> > belowed:
> >     try
> >    {
> >      MailMessage mailObj = new MailMessage();
> >      mailObj.To.Add(receipientAddr);
> >      mailObj.From = new MailAddress(senderAddr);
> >
> >      mailObj.Subject = "very good";
> >      mailObj.Body = "thank you";
> >
> >      mailObj.IsBodyHtml = true;
> >      mailObj.Priority = MailPriority.High;
> >      mailObj.BodyEncoding = System.Text.Encoding.UTF8;
> >
> >
> >     System.Net.Mail.SmtpClient client = new
> > System.Net.Mail.SmtpClient(smtpServerIP);
> >     client.UseDefaultCredentials = false;
> >     mailObj.SubjectEncoding = System.Text.Encoding.UTF8;
> >     client.Credentials = new
> > System.Net.NetworkCredential(this.tb_mailUserName.Text,
> > this.tb_mailUserPassword.Text);
> >     client.DeliveryMethod = SmtpDeliveryMethod.Network;
> >      client.Send(mailObj);
> >
> >    }
> >    catch(Exception ex)
> >    {
> >      MessageBox.Show(ex.Message.ToString());
> >      return;
> >    }
> >
> >    when smtpServerIP is specified with some smtp server ips, the mail
can be
> > delievered correctly.But over some smtp servers such as
"smtp.21cn.com",the
Show quote
> > codes didn't throw any exception and seemed to have work well,but when I
> > logined mail.21cn.com,I could not  find the expectedly incoming mail.
Could
> > anyone help me?
> >
> > Crespo
> > 2006-07-03
> >
> >
> >
Author
5 Jul 2006 11:39 AM
Göran_Andersson
What specifically was it that you didn't understand?

Crespo wrote:
Show quote
> Thank you,Mr Andersson. I don't understand well what you explained,could you
> give me more detail? Thank you very much.
>
>   Crespo
>
> "Göran Andersson" <gu***@guffa.com> ????
> news:uEid5F8nGHA.4364@TK2MSFTNGP05.phx.gbl...
>> Many ISPs have closed the port used by SMTP, so that you can only send
>> mail using their mail server, to prevent spamming.
>>
>> Crespo wrote:
>>> hi,every one! I have a question about sending emails.My codes works well
>>> over some smtp servers,but doesn't over the others. My codes is listed
>>> belowed:
>>>     try
>>>    {
>>>      MailMessage mailObj = new MailMessage();
>>>      mailObj.To.Add(receipientAddr);
>>>      mailObj.From = new MailAddress(senderAddr);
>>>
>>>      mailObj.Subject = "very good";
>>>      mailObj.Body = "thank you";
>>>
>>>      mailObj.IsBodyHtml = true;
>>>      mailObj.Priority = MailPriority.High;
>>>      mailObj.BodyEncoding = System.Text.Encoding.UTF8;
>>>
>>>
>>>     System.Net.Mail.SmtpClient client = new
>>> System.Net.Mail.SmtpClient(smtpServerIP);
>>>     client.UseDefaultCredentials = false;
>>>     mailObj.SubjectEncoding = System.Text.Encoding.UTF8;
>>>     client.Credentials = new
>>> System.Net.NetworkCredential(this.tb_mailUserName.Text,
>>> this.tb_mailUserPassword.Text);
>>>     client.DeliveryMethod = SmtpDeliveryMethod.Network;
>>>      client.Send(mailObj);
>>>
>>>    }
>>>    catch(Exception ex)
>>>    {
>>>      MessageBox.Show(ex.Message.ToString());
>>>      return;
>>>    }
>>>
>>>    when smtpServerIP is specified with some smtp server ips, the mail
> can be
>>> delievered correctly.But over some smtp servers such as
> "smtp.21cn.com",the
>>> codes didn't throw any exception and seemed to have work well,but when I
>>> logined mail.21cn.com,I could not  find the expectedly incoming mail.
> Could
>>> anyone help me?
>>>
>>> Crespo
>>> 2006-07-03
>>>
>>>
>>>
>
>
Author
6 Jul 2006 2:41 AM
Crespo
Thank you,i have got it.Your explaination is good. Thanks again.

Crespo.
Show quote
"Göran Andersson" <gu***@guffa.com> ????
news:u2pC5eCoGHA.4728@TK2MSFTNGP05.phx.gbl...
> What specifically was it that you didn't understand?
>
> Crespo wrote:
> > Thank you,Mr Andersson. I don't understand well what you explained,could
you
> > give me more detail? Thank you very much.
> >
> >   Crespo
> >
> > "Göran Andersson" <gu***@guffa.com> ????
> > news:uEid5F8nGHA.4364@TK2MSFTNGP05.phx.gbl...
> >> Many ISPs have closed the port used by SMTP, so that you can only send
> >> mail using their mail server, to prevent spamming.
> >>
> >> Crespo wrote:
> >>> hi,every one! I have a question about sending emails.My codes works
well
> >>> over some smtp servers,but doesn't over the others. My codes is listed
> >>> belowed:
> >>>     try
> >>>    {
> >>>      MailMessage mailObj = new MailMessage();
> >>>      mailObj.To.Add(receipientAddr);
> >>>      mailObj.From = new MailAddress(senderAddr);
> >>>
> >>>      mailObj.Subject = "very good";
> >>>      mailObj.Body = "thank you";
> >>>
> >>>      mailObj.IsBodyHtml = true;
> >>>      mailObj.Priority = MailPriority.High;
> >>>      mailObj.BodyEncoding = System.Text.Encoding.UTF8;
> >>>
> >>>
> >>>     System.Net.Mail.SmtpClient client = new
> >>> System.Net.Mail.SmtpClient(smtpServerIP);
> >>>     client.UseDefaultCredentials = false;
> >>>     mailObj.SubjectEncoding = System.Text.Encoding.UTF8;
> >>>     client.Credentials = new
> >>> System.Net.NetworkCredential(this.tb_mailUserName.Text,
> >>> this.tb_mailUserPassword.Text);
> >>>     client.DeliveryMethod = SmtpDeliveryMethod.Network;
> >>>      client.Send(mailObj);
> >>>
> >>>    }
> >>>    catch(Exception ex)
> >>>    {
> >>>      MessageBox.Show(ex.Message.ToString());
> >>>      return;
> >>>    }
> >>>
> >>>    when smtpServerIP is specified with some smtp server ips, the mail
> > can be
> >>> delievered correctly.But over some smtp servers such as
> > "smtp.21cn.com",the
> >>> codes didn't throw any exception and seemed to have work well,but when
I
> >>> logined mail.21cn.com,I could not  find the expectedly incoming mail.
> > Could
> >>> anyone help me?
> >>>
> >>> Crespo
> >>> 2006-07-03
> >>>
> >>>
> >>>
> >
> >

AddThis Social Bookmark Button