sending mail to any website using java servlet - servlets

I am using javamail api in java servlet to send mail. It seams to send mail only to gmail Id's, whereas I want it to be able to send to any email ID. Do I require different property value here? I followed http://www.mkyong.com/java/javamail-api-sending-email-via-gmail-smtp-example/ to develop the code. The property values are:
props.setProperty("mail.smtp.host", "smtp.gmail.com");
props.setProperty("mail.smtp.port", "587");
props.setProperty("mail.smtp.auth", "true");
props.setProperty("mail.smtp.starttls.enable", "true");

No , There is no need to change configurations what you have ,Here it will act as server(Gmail) from there you can send mail to any mail servers(yahoo,hotmail and etc..).

You can send mail to any email ids. You can mention them in TO address or CC or BCC, check your authentications are correct.
Here is an detailed example from an existing post how to send an email from jsp/servlet?
Hope this can help you

Related

Firebase Authentication: Emails sent but not received on special email addresses such as *#gmx.at

I am using Firebase Authentication in my Ionic App. Some users have reported to not receive the verification email which is sent after a user signs up, or when the resendVerificationEmail is triggered.
This works fine for email providers like #gmail.com or #live.de, but for those other users with special providers like #gmx.at it's not working. The emails are sent successfully according to firebase but they are never received.
Possibly the emails get filtered?
Has anyone else ran into this problem? The message template can not be modified but would using a custom SMTP server possibly help?
The problem is solved by using my own private SMTP server for sending the Authentication emails.
I am using a hosting service for my domain that comes with email service so I am using that one. Using other services such as Mailgun or Mailjet etc. might also solve the problem.
You can set up your custom SMTP server right in the firebase console under Authentication/Templates.
I had the same problem with others emails providers (orange.fr sfr.fr free.fr ...). After deeper analysis, it appeared that it is the domain address inside the (generated) link that is detected as SPAM by emails providers (maybe everything that sounds like *.firebaseapp.com)
https://your-subdomain.firebaseapp.com/__/auth/action...
I changed it to a custom one of mine (through Authentication->templates->"Customize action URL" (bottom right)):
https://www.my-custom-domain.com/__/auth/action
and no more problem!
Some doc (note on blue background):
https://firebase.google.com/docs/auth/custom-email-handler?hl=en&authuser=0#link_to_your_custom_handler_in_your_email_templates

how to send email in wordpress not using plugin

I am new developer in wordpress. I wanna send email not using plugin . i use function wp_mail as shown below:
wp_mail('myname#yahoo.com', 'subject', 'message', $headers);
when i use yahoo email myname#yahoo.com i can send 'subject,messege' to my yahoo account. but when i use gmail email xxx#gmail.com i can't send 'subject,messege' to my gmail account.why can not send with gmail account? pleas help me !
As you have problem with only Gmail we can infer that it is not the problem with 'sending' but with 'receiving'. Something is blocking your mail at the receiving end. Following things can be done to ensure better receiption.
Use a real address. Dafult is wordpress#yourdomain.com. This can be filtered with wp_mail_from.
Use SMTP to send email. You can do this with phpmailer_init action.
Disable headers.
Contact hosting providers and confirm that your server is not blacklisted by Gmail.
If you used wp_mail to send your message, without a plugin, this means you didn't use Google's SMTP server. And you're wondering why you didn't receive it at your gmail account? Because you basically forged your from address. Of course Google rejected your email.
The only way to get that to work is to use authentication when sending your mail. That means connecting to the smtp.gmail.com server and in 2015 that means using OAuth 2.0 unless you want to deal with another can of worms.
Check out Postman SMTP for sending mail in WordPress.
Here's some reading for you to do: http://googleappsdeveloper.blogspot.no/2014/10/updates-on-authentication-for-gmail.html

Sending mail without smtp server and credentials in asp.net

I have a contact us form in one of my asp.net website, which contains following field:
NameContact NumberEmail AddressSubjectMessage
Now whenever user fill up the form and submit it, i want to receive mail in my inbox with the user's mail as the "from".Now as i don't know which server user would be using and his credentials, how can i send the mail, "from" as his email address and "to" as mine.I know that's quite possible, here is one of the site who does exactly that
Once you choose any of the greetings and click on send, it will ask you for sender's name and email and receiver's name and email and it sends email to receiver with the senders mail in the from field.
SmtpClient uses MailMessage to send emails. MailMessage has From property. See the link, it has code example
http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.from.aspx
Not sure if this overkill for what you want to do, but I have used this in the past with great results, especially with sending both text and HTML versions of email.
Open Source .NET e-Mail Templating Engine

Web service to check existence of email?

I have my little web application, with simple registration strategy - provide email and password and you are done.
Recently bot's starting to attack my application, registering big number of users from non existent emails using the same passwords.
I want to prevent that. My idea is to extend login verification, but check the existance of email address. Do you know any web services (prefereably WCF) that could do that?
This is definitely not the way to solve this problem. Try one of these
Allow user to enter only username and send auto-generated password to their email.
Send a verification link to the user email and approve him/her only after verification
This has been discussed on How to check if an email address exists without sending an email? . Basically there are ways verify email addresses, but in practice none of them is reliable. However, you can still check via SMTP, and if the server denies the existence of the expected user, send him an email with a verification link anyway. This does not prevent spammers from setting up fake servers that acknowledge the existence of any user, of using other peoples email addresses, but it's probably the closest you can get to your initial requirement of having no verification email.
I would recommend you to update your registration form. Try to use something tricky for bots. For example, post the form via AJAX with JSON object wrapper.
Try a service like: http://elasticemail.com/
You can use the api to check if the email was delivered. There is also a 'bouce list' you can check.

Check if mail sent is in recipient's inbox/junk in asp.net using C# ?

I am developing a software but for that I want to know as if i send an email then how can i check the sent email is in recipient's inbox/ Junk.
I am using AsP.net and c# technology for this
Please reply
You can't detect what is done with the email once it is delivered to the users inbox other than requesting a delivery receipt and a read receipt but the user can opt out of these.
The best way to avoid being marked as spam is to use a trusted third party service such as Campaign Monitor or MailChimp.
Failing that you should make sure that your email has a proper from address set, that you have set up SPF records to allow the sending IP official permission to send email on behalf of the from domain, keep your html to content ratio reasonable and if possible use an email address that your customers have already received an email from before so that there is a higher chance that the address is already in a whitelist.
You really can't because there are many different email spam solutions out there and they don't send a status back saying whether they delivered the email to the recipient or not. What you can do is send an email with a tracker to see if the receiver opened it.
http://www.aspnetemail.com/samples/emailtracker/default.aspx

Resources