Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: Sending block of emails Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
raindm
Groupie
Groupie
Avatar

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 22 June 2008 at 12:47am | IP Logged Quote raindm

hello

If i sort my emails by domain, is it possible to send block of emails to the same domain with 1 handshake?
Example:

I have block of 200 emails that ends with @gmail.com
instead of doing handshake with direct send to each email i want to send the whole 200 email block directly to gmail mail servers. What is the correct way to accomplish that?
I know this is possible, but not sure how.




Back to Top View raindm's Profile Search for other posts by raindm
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 22 June 2008 at 4:25am | IP Logged Quote Andrew

Just connect to necessary SMTP server and send necessary number of messages.

If you need to send messages directly to recipients SMTP servers (direct send), use Smtp.GetMXHosts method as described here.


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

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 22 June 2008 at 5:15am | IP Logged Quote raindm

do you mean to use smtp.GetMXHosts and get the mail server from a domain and use connect to connect to that mail server and send a block of messages?
for examle:
if i do: string[] hosts = mailer.GetMXHosts("gmail.com");
i get all gmail.com mail servers, right?
if i have like 200 emails of gmail and i want to send it with 1 handshake can it be done with direct send or i need to use .connect to connect to the mail server i receive from "mailer.GetMXHosts("gmail.com")" and send using that?
Back to Top View raindm's Profile Search for other posts by raindm
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 22 June 2008 at 6:18am | IP Logged Quote Andrew

Quote:
do you mean to use smtp.GetMXHosts and get the mail server from a domain and use connect to connect to that mail server and send a block of messages?


Exactly.

Quote:
if i do: string[] hosts = mailer.GetMXHosts("gmail.com");
i get all gmail.com mail servers, right?


Yes.

Quote:
if i have like 200 emails of gmail and i want to send it with 1 handshake can it be done with direct send or i need to use .connect to connect to the mail server i receive from "mailer.GetMXHosts("gmail.com")" and send using that?


Because you need to send multiple mails during 1 handshake, the second approach is right.

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

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 22 June 2008 at 7:40am | IP Logged Quote raindm

Thank you for the reply.
The second approach is connecting to the mail server like mail.gmail.com (or whatever mail server name they have). and sending all the 200 gmail emails i have directly to there smtp server. is this the second approach you meant?
Its like connecting to google mail server and doing the mailer.send like 200 times in a loop. is there another way without the loop?

By the way.. i dont think gmail allow to send emails to there clients directly from there mail servers ..Is this correct?
Back to Top View raindm's Profile Search for other posts by raindm
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 22 June 2008 at 8:52am | IP Logged Quote Andrew

Quote:
The second approach is connecting to the mail server like mail.gmail.com (or whatever mail server name they have). and sending all the 200 gmail emails i have directly to there smtp server. is this the second approach you meant?


Yes.

Quote:
Its like connecting to google mail server and doing the mailer.send like 200 times in a loop. is there another way without the loop?


Another way is to use SendMailMerge or AddJob/SendJobs pair. In this case, you don't need to connect to server manually, these methods connect and send messages within the same handshake.

Quote:
By the way.. i dont think gmail allow to send emails to there clients directly from there mail servers ..Is this correct?


If the host you send from has MX record assigned, any mail server would accept its messages because it'd look like normal SMTP server. Anyway, you don't have to send messages directly to Gmail. If you have a relay SMTP server, you may send all messages to this server within the same handshake, it'd deliver them to recipients servers.

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

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 23 June 2008 at 12:00am | IP Logged Quote raindm

you said:
. If you have a relay SMTP server, you may send all messages to this server within the same handshake, it'd deliver them to recipients servers.

correct, but after i send this server within the same handshake how does the server send the messanges? does it send by .connecting to goolg email server or does it do directsend.
I am asking because i am handling the sending not the relay smtp server.
I thought relay smtp server software send a message 1 by 1 using direct send.
Back to Top View raindm's Profile Search for other posts by raindm
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 23 June 2008 at 12:57am | IP Logged Quote Andrew

Quote:
correct, but after i send this server within the same handshake how does the server send the messanges?


This is the relay SMTP server matter. Once you sent messages to a relay SMTP server, it should take care of their delivery, you shouldn't worry about this.

Quote:
does it send by .connecting to goolg email server or does it do directsend.


Direct send just means resolving recipient SMTP server address by your application and sending message to that server. When sending messages to recipients servers directly, MailBee.NET SMTP component connects to these servers too. "Direct send" term is applicable to your application which sends messages, but not for SMTP servers which send messages to other ones directly.

Quote:
I am asking because i am handling the sending not the relay smtp server.


If you don't use a relay SMTP, you should use GetMXHosts to directly send messages in a bunch.

Quote:
I thought relay smtp server software send a message 1 by 1 using direct send.


Why should you worry whether the server delivers them in a bunch or one-by-one?

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

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 23 June 2008 at 1:59am | IP Logged Quote raindm

I worry because i need to know how in what way smtp relay sends to be able to simulate this method.

You said to use GetMXHosts.
Lets say i use GetMXHosts.. How do i deliver them messages in a bunch. do you have example for this?
Back to Top View raindm's Profile Search for other posts by raindm
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 23 June 2008 at 2:48am | IP Logged Quote Andrew

This sample allows you to send a bunch of messages based on a template. You should just replace:

Code:
mailer.SmtpServers.Add("mail.domain.com", "jdoe", "secret");


with:

Code:
mailer.SmtpServers.Add(mailer.GetMXHosts("domain.com")[0]);


to send messages directly to domain.com SMTP server.

If you don't need to send messages based on a template, you should connect to SMTP server obtained via GetMXHosts and organize a loop with Smtp.Send method inside.

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

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 23 June 2008 at 2:54am | IP Logged Quote raindm

Thank you for your reply.
I tried doing this with gmail.com (i have all mx records and other records assigned correctly) .. google smtp server is: smtp1.google.com to smtp4.google.com
but it says : "relaying dendied."
Back to Top View raindm's Profile Search for other posts by raindm
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 23 June 2008 at 3:10am | IP Logged Quote Andrew

Please enable logging, reproduce the issue and provide us with the log file for examination.

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

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 23 June 2008 at 7:49am | IP Logged Quote raindm

Thank you

Just to remind that i was using .connect to connect to gmail stmp server..
Back to Top View raindm's Profile Search for other posts by raindm
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 24 June 2008 at 3:12am | IP Logged Quote Andrew

Thank you for the log file. This happens because you try to send to Gmail relay SMTP server. If you execute the following code:

Code:
Smtp mailer = new Smtp();

mailer.DnsServers.Autodetect(DnsAutodetectOptions.Wmi);

string[] hosts = mailer.GetMXHosts("gmail.com");

foreach (string host in hosts)
{
   Console.WriteLine(host);
}

Console.ReadLine();


You'll get the following list of MX servers:

gmail-smtp-in.l.google.com
alt1.gmail-smtp-in.l.google.com
alt2.gmail-smtp-in.l.google.com
gsmtp183.google.com
gsmtp147.google.com

Try sending to one of these servers.


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

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 28 June 2008 at 12:22am | IP Logged Quote raindm

Hi, this did work, thanks!

Does the email providers have any limits of how many emails i can send per handshake? or how much connections to there mx mail server can be established at oncs?
Back to Top View raindm's Profile Search for other posts by raindm
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 28 June 2008 at 12:16pm | IP Logged Quote Andrew

Some e-mail providers apply such limitations (and/or some others), but there's no common strategy, it depends on a certain provider.

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

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 28 June 2008 at 12:40pm | IP Logged Quote raindm

When you say "some others". i am not familiar with other limitations than numbers of connections at the same time and quantity emails I send per connection ( before disconnecting).. This i am refering when connection to an mx record mail server and start sending emails.
What other limitations ? i need this to be able to configure my application to be able to handle the "other" limitations.

What i am thinking to do is: 1) to be able to configure how many connection could be established per domain
2) how many emails could be sent per connection..

Is this correct method ?
sorry for the offtopic question....
Back to Top View raindm's Profile Search for other posts by raindm
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 28 June 2008 at 9:57pm | IP Logged Quote Andrew

One of the most popular limitations is number of messages allowed to be sent per hour from the same IP.

Quote:
What i am thinking to do is: 1) to be able to configure how many connection could be established per domain
2) how many emails could be sent per connection..

Is this correct method ?


Yes.

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

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 29 June 2008 at 3:24am | IP Logged Quote raindm

Is this limitation apply when whitlisting a domain..?
Back to Top View raindm's Profile Search for other posts by raindm
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 29 June 2008 at 4:18am | IP Logged Quote Andrew

Depends on a certain provider. It's hard to say anything for sure because each provider has its own strategy. Moreover, providers may not advertise limits and you wouldn't be aware of them until you reach them (it's assumed usual senders never reach those limits due to sending small amount of messages).

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

Joined: 31 January 2008
Location: Israel
Online Status: Offline
Posts: 44
Posted: 29 June 2008 at 4:59am | IP Logged Quote raindm

ok, thanks a lot.
Back to Top View raindm's Profile Search for other posts by raindm
 

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