Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: Emails being sent to any mail address Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
raosid
Newbie
Newbie
Avatar

Joined: 26 February 2009
Location: India
Online Status: Offline
Posts: 1
Posted: 26 February 2009 at 10:01am | IP Logged Quote raosid

Hi,

I am trying to catch the bounce emails in a small function. something like this:
Smtp.LicenseKey = "eeee-eeeeeeeeeeeeeeeeeeeeeeeeee-eeee";
        Smtp mailer = new Smtp();        mailer.DeliveryNotification.TrackingID = "Jan2007_##ID##";
              mailer.SmtpServers.Add("mail.vvv.com", "v@v.com", "vvvv", AuthenticationMethods.Auto);
        string failedIndices = null;
        DataTable table = new DataTable();
        table.Columns.Add("emails");
        table.Rows.Add("siddhah.a@678575lutions.com");
        table.Rows.Add("siddhu.1983@gmail.com");
        table.Rows.Add("siddha@56575675.com");

        for (int i = 0; i < table.Rows.Count; i++)
        {
             mailer.From.AsString = "aaa@sss.com";
             mailer.To.AsString = table.Rows[0].ToString();
             mailer.Subject = "Weekly newsletter";
             mailer.BodyPlainText = "This is the newsletter contents";
             if(mailer.TestSend(SendFailureThreshold.AllRecip ientsFailed) != TestSendResult.OK)
             mailer.AddJob(null, "v@v.com", null);
        }
        mailer.SendJobs();
        string notifications = "", notificationf="";
       
             for (int i = 0; i < mailer.JobsSuccessful.Count; i++)
             {
                for (int j = 0; j < mailer.JobsSuccessful.Recipients.Count; j++)
                {
                     if (notifications == "")
                          notifications = "mails sent to <br/>" + (i + 1) + ". " + mailer.JobsSuccessful.Recipients[j].Email;
                     else
                          notifications += "<br/>" + (i + 1) + ". " + mailer.JobsSuccessful.Recipients[j].Email;
                }
             }
             Response.Write(notifications);
       
             for (int i = 0; i < mailer.JobsFailed.Count; i++)
             {
                for (int j = 0; j < mailer.JobsFailed.Recipients.Count; j++)
                {
                     if (notificationf == "")
                          notificationf = "<br/>mails not sent to <br/>" + (i + 1) + ". " + mailer.JobsFailed.Recipients[j].Email;
                     else
                          notificationf += "<br/>" + (i + 1) + ". " + mailer.JobsFailed.Recipients[j].Email;
                }
             }
             Response.Write(notificationf);

But, its sending mails to everybody. How can i track which emails are sent and which are failed? Can someone please provide a code ?
Back to Top View raosid's Profile Search for other posts by raosid
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 27 February 2009 at 2:53am | IP Logged Quote Andrew

If all the jobs go to mailer.JobsSuccessful, that means your SMTP relay server accepted all the messages successfully. That's ordinary occurrence. Further delivery is concern of the relay SMTP server.

To catch bounce messages, you need to poll (through POP3 or IMAP) the account the messages are sent from. To learn more about processing bounce messages, please refer to this tutorial. Delivery notifications are sent back to sender's address too.

Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide