today i'm researching about the jmeter.
connect the gmail
login
send email
I passed 2 step and got error "java.net.UnknownHostException: mail.google.com" on step 3
Login :
Send Email :
I connected the link "mail.google.com" on the website.
Can somebody teach me what am i wrong ?
I would recommend using SMTP Sampler instead of simulating sending an email using web interface.
The relevant configuration would be:
Server: smtp.googlemail.com
Port: 587
Address from: your Gmail address
Address to: recipient address(es)
Check "Use Auth" and provide your full GMail username and password
Tick "Use StarTLS" radiobutton
Other fields are pretty much self-explanatory
References:
Set up Gmail with Outlook, Apple Mail, or other mail clients
Load Testing Your Email Server: How to Send and Receive E-mails with JMeter
I know this is not an answer you will like, but you should not be pointing any performance testing tool at a server you do not own, control or manage (or have permission from the people who do). In addition, Google's own end user agreement prohibits this behavior, supporting automation only with their published API set. License-wise and ethically, this is a problematic set of behavior for performance testing.
If you wish to experiment, then consider setting up a LAMP stack box inside of your own domain/control with an SMTP relay, pointing to mailbox destinations on that server. If you must test routing then setup two email servers with destinations on the opposite host (easy with two virtual machines).
Note, SMTP supports direct addressing, such as [name]#[host|IP address] so you can control directly any email routing to outside mailboxes accidentally and SPAMming individuals or organizations. This also avoids the problem of clogging up an SMTP relay with thousands of messages undeliverable due to lack of a valid address - this last condition will slow all email delivery for an organization and if not addressed can grind delivery to a halt before the first undeliverable messages start failing out after the delivery timeout is reached which is typically around 72 hours.
Related
I'm experiencing a weird issue with my mail server. Currently i'm using Apache James as a relay to dispatch emails to an external mail server. Sometime it happens that even if I receive an SMTP code 250 from the external mail server, the email diasappears and never get delivered or it is delivered after a very long time. Point is: am i right assuming that until i receive the SMTP code 250 of successful delivery from the external server, it is not a problem of my mail server?
Even you get SMTP return code 250, it doesn't guarantee your email will arrive in final destination.
That return code means that the relay server ACCEPTS your email-delivery request. After they accept the request, who knows what happen after that. Several possibilities:
The remote server scan your email with AntiSpam daemon and (unfortunately) your email is mis-idenfified as spam. So they discard/drop it.
The remote server just don't like your email. Maybe your IP Address blacklisted. So they silently discard it.
The remote server is busy processing other jobs. So they delay your email delivery.
The server happily to forward your email to final destination right now.
Further info: Simple_Mail_Transfer_Protocol on Wikipedia
I want to send an email without using SMTP protocol. Is that possible to implement using Java? Since, my remote machine does not have access to google, yahoo and other accounts. and even my office mail can not be configured using SMTP server due to some security issues. Is any other way to send an email from remote machine.
The JavaMail section at java.sun.com lists many third party products that plugin to the JavaMail API. Hopefully one of those will fit your needs but I can't be more specific because you don't say what non-SMTP sending options you have open to you.
You could setup Your own SMTP server on remote machine, IMHO, it is better than incorporate it into program directly.
I want to send an email without using
SMTP protocol. Is that possible to
implement using Java?
With Java you can implement any Layer-5 network protocol.
ALL mail servers using SMTP to receive messages. At any time you have to connect with SMTP to the destination mail server.
If you cannot get out from local network to the Internet with some services you will need a proxy or network tunnel to connect the destination.
In a Java program, what is the best way of determining if an SMTP server is ready to accept and send an email?
You can use JavaMail API and try to send an email.
If you don't want to actually send the email, you can open a TCP socket to port number 25 of your mail server and send the following commands:
HELO yourdomain.com
MAIL FROM: youremail#yourdomain.com
RCPT TO: recipient#recipientdomain.com
Make sure you check all server responses after each command issued. If you don't see any errors until that point, then probably you will be able to send emails with that SMTP server.
And, as Jordan Stewart kindly appointed:
You'll also want to make sure that the
HELO domain has a complementary A /
PTR dns record pair, with the IP
address the domain is mapped to being
the IP address you're connecting from.
The domain also needs at least one MX
record. I.e. if the server you're
connecting from is 123.45.67.89 then
you'd need an A record mapping
yourdomain.com to 123.45.67.89 and a
PTR ("reverse DNS") record mapping
123.45.67.89 back to yourdomain.com. If any of these conditions aren't met
you'll run into problems with some
mail servers as checks for these
things are anti-spam measures.
I have an app which is programmatically generating and sending out emails. The recipients list can get upwards of 1000. I had been looping through and sending out individual emails, but that was taking too long at about .5 sec each. The approach I'm looking into now is to remove customization in the message body and send out a single email with all addresses in the BCC. (Maybe other solutions are possible and I welcome them, but I'm mainly interested in delving into the complexities of this BCC solution.)
Is there a limit to the number of recipients allowed on a single email? Is this wholly dependent on my email client and/or SMTP server's configuration? Are there other limits outside the control of my domain? Furthermore, how is BCC handled? I assume that the BCC distribution needs to be broken down into separate mail messages at some point. Is the mail client (in my case javax.mail) responsible for this, or does the mail server do this?
I'm also interested in suggestions of how can I test my new email blaster program?
I don't think it will be a valid test by creating 1000 accounts at google or wherever (nor do I want to). I've heard there are some mail server optimizations geared toward multiple recipients at the same host. In my case, most will be distinct hosts.
Another way is to involve all the recipients to see if they recieved the email. I can do this, but I want to avoid spamming them, assuming I may need to test multiple times if things don't go right the first time.
Or do I just assume some limitation and send out batches of emails with some arbitrary number of recipients each, say 50 or 100?
BCC works inside your SMTP server; no recipients ever know other BCC'ed email addresses, so this is a limitation that depends entirely on your SMTP server.
You should check with your server administrator.
even more definitive, the RFC that covers SMTP (2821) makes no mention of recipient limitations outside of mail-server specific ones:
"If an SMTP server has an implementation limit on the number of RCPT
commands and this limit is exhausted, it MUST use a response code of
452 (but the client SHOULD also be prepared for a 552, as noted
above). If the server has a configured site-policy limitation on the
number of RCPT commands, it MAY instead use a 5XX response code.
This would be most appropriate if the policy limitation was intended
to apply if the total recipient count for a particular message body
were enforced even if that message body was sent in multiple mail
transactions."
http://www.ietf.org/rfc/rfc2821.txt
Thanks for your comments. As I understand it now, the outgoing SMTP server will be responsible for breaking up each of the messages. In construction of the new messages, the outgoing SMTP server will only send applicable RCPT TO commands for each BCC recipient. So in the case where all recipients are BCC, there will be only one RCPT TO command for each message.
That being the case, it seems like I really only need be concerned about our outgoing SMTP server configuration. No need to worry about the destination SMTP servers.
I got a suggestion that seems like a good way to test this. I could send my message to a number of recipients, each with a unique bogus child domain of our valid parent domain. When no MX record is found for the child, the parent will be used. The outgoing SMTP server will not be aware that the bogus domains don't exist, so this should avoid any SMTP optimatization for multiple recipients with common domains. We can probably also configure that these messages will all get routed to the same inbox.
I have read that to send email in Java I need to obtain my ISP's SMTP address, but if I am intending to host my web app online, will this be my hosts ISP SMTP address?
EDIT: So I need to find out my clients ISP's SMTP address and send via this?
JavaMail is the built-in API for e-mail.
Ask your ISP if the host runs sendmail or equivalent locally (the web server host). It may be an advantage to hand off to sendmail as early as possible. In other words, try "localhost" as the SMTP server name.
Why? JavaMail is a simple SMTP client. It doesn't deal with DNS MX records. It doesn't have a built-in capability to queue mail if the SMTP server is unavailable. There's the default Java infinte DNS cache so that a DNS change to the SMTP host won't register with your app (tunable, but one more tuning to do). These are things that a local sendmail (or equivalent) process will do.
So if you can hand off the e-mail to a local sendmail/equivalent, that may improve e-mail delivery reliability. Assuming the local sendmail works, of course. It's how we configure some in-house apps that uses JavaMail to send mail and fixed all the above problems.
No, unless your webhost is the same as your ISP or your webhost also offers SMTP services.
In response to your edit, yes you need your ISP's SMTP address by the sound of things.
It will be the SMTP address you want to forward email through.
If you want to send email through your ISP account then it will be that SMTP.