0

I am not able to send email in server if increasing timeout property.

//set the SMTP info SmtpClient smtp = new SmtpClient(); smtp.Host = strServer; //IP Mail Server smtp.Timeout = 70 * 60 * 1000; smtp.Port = Convert.ToInt16(Port); //Port smtp.Credentials = new System.Net.NetworkCredential(FromAddress, strPassword); //send the email smtp.Send(Msg); 

In my application i want to send 'B'-day mail nearly 1000 people. so i will send emails "To" those who hve birthday and put "bcc" to rest of the employees nearly 1000.if am not adding bcc it is working perfectly .if i'm adding bcc(1000 people) its giving error like "Time out". i add nearly 1 hour time out for overcome this. i know it is not a good practise but when i'm adding this it is working in local but not in server. in server it is givng error "Failure ending mail".suppose if i'm reduce time out to 10min ,its not giving any exception but not getting mail. i want to know i'm missing anything here ? is this server config problem..? please help me to sort this out

2
  • Try adding those 1000 people in a group and send email to group. Commented Sep 29, 2014 at 5:13
  • @Maheep first these 1000 people are in a group,then its not working . so i added in bcc one by one. Commented Sep 29, 2014 at 5:16

2 Answers 2

1

this is because of adding too many people at a time. try doing the same thing with your email on web browser and it will not allow you to send email.

To resolve this try making multiple groups out of 1000 emails like group of 100 or 200 and sending the mail to those groups.

NOTE 1) Check if firewall settings are off 2) Check if antivirus is installed, on sending email the antivirus asks to allow or not OR you could go in antivirus settings and disable the mail check options

Sign up to request clarification or add additional context in comments.

5 Comments

i tried that one also.each time sending email i put 100 people in bcc . but when i'm doing this i'm getting one attachment file like ATT0005. second time i'm getting one file 3rd time 2 file 4th time 3 file like that. but in local bcc working with 1000 people
please clear my 2 doubts:-1) what do you mean by "but in local bcc working with 1000 people" 2) as attachment is concerned you have to clear the attachment list otherwise at every attachment add you will get attachment count increased.
i)Hi when i'm testing this application in my local sysytem its working fine.2)i am not adding any attachment in email
where is the problem if application is running ok in local system?
in server it is giving error like "Failure sending mail". in server it is not working.
0

I want to share my experience with sending emails.I also used to send B-Day emails but in my case there were usually 100-150 people and all mails delivered successfully. I had made a web service for this whose only task was to send emails. But before emails started to deliver successfully we tested on local machine which worked fine but when we tested it on server i face the same issue and cause of this failure was that we deployed our web service in .Net framework 2.0 than we changed it to 4.0 and tested it again with 10000,5000,1000 emails and it worked fine not all emails but most of them reached destination.Also one more thing to mention is that the address from which we were sending email was restricted by network department in email server to send only 100 emails.Also try to avoid sending too many emails from one sender and from one email server because you can get black listed.

Summary

  • First of all check that are you using .Net framework 2.0 if yes switch to 4.0.
  • Make sure that there are no restrictions by network department at email server and also to address which you use as sender.
  • Place all your code in using statement to make sure objects get disposed.
  • Send your emails in chunks(About 100 at a time).

    using() { //Place you email sending code here. }

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.