I'm using a gmail account to send email notifications from the app,
but the problem appears when my customers start using this app. Gmail is blocking login attempts at my customer's locations and notify me about suspicious login attempts.
What is the best practice to send email notification from the app from different locations? I would like to keep the same sender email address.
Send your notice to a web service and have that send you an e-mail. Relying on user's email systems to be configured properly will lead to disappointment.
Related
I have several inquiry forms that I'd like to use a Gmail account to authenticate and send through. The forms send successfully, but the reply-to address is always the Gmail account, rather than the person's e-mail who filled out the form. This is a problem for the client in that they can't hit "Reply" without changing the reply-to address.
I've poked around the Gmail account and don't see anything that appears switch anything on and off to fix this. Any ideas?
My guess is that this is a restriction when using gmail as your SMTP server. You could use a different SMTP server to send the emails like MailDrill or MailGun.
OR
...and I'm not sure this will work. You can configure your gmail account to allow you to send emails with a different reply address/alias, but each address requires confirmation.
The steps to do this are located here
EDIT: I just re-read your message. Since you're using form data for the address I think your only option may be to use an alternate SMTP server.
Sorry I don't have a better answer.
What happens when the outgoing mail server is not part of the local domain? For example, I work for company xyz.com and our smtp server is mail.xyz.com. We host client sites in a multitennant application. We allow our users to point to their own smtp server using email configurations we store in our database.
The code we use to send emails loads the configuration with the smtp information and the authorization needed to send an email on behalf of our clients through their email system.
Currently we are running into concurrency issue that is causing timeouts for various clients when notifications are being processed. They are currently configured to be sent immediately. I've read that moving to the local pickup directory can solve this issue.
I am concerned if I specify a path like C:\Temp\Mail but use an SMTP connection to a clients mail server is that going to work? Doesn't the email being created and sent from the pickup location need to be on the same domain as the smtp server?
How will the clients SMTP server know .eml file has been generated for their domain and needs to be sent out without having to change our client's environment? If someone can provide any information as to how the SMTP and Specified Pickup Locations work I would greatly appreciate it.
The basic operation of an SMTP server in this sense is to monitor a specific set of folders and perform an action when an event occurs. Where your concern is is in that a file dropped into the pickup location is parsed and sent.
The basic SMTP operation allows any email server to send any email regardless of the domain that the email says it is from. This obviously caused issues with fraudulent emails and has been mitigated originally by Designated Sender and further extended via SPF, DIM, and DMARC.
So what your client would need to do is to have their SMTP setup properly and configured for your email domain(s). On your end it would be recommended to only allow the Designated Senders generate emails, and set up SPF etc for those clients as well
Microsoft has a good article on the SMTP basics How SMTP Works
Google has plenty of lists for SPF, DKIM, and DMARC as well.
I know there many articles on web regarding sending emails from code/C# and I have read many of them before posting here, but I still don't see a clear picture of how to implement my requirements:
Scenario:
My application on mydomain.com receives a request to send some kind of email (from: someone#mydomain.com, to: someone#gmail.com/anyother.com).
I need to make some manipulations on email content.
After I modified a message, I need to send it directly to recipient.
Under directly to recipient I mean that I want to send it to recipient by our servers and not using some kind of SMTP service/relay.
So as I understand I can install some SMTP software on our servers and send using System.Net.Mail.SmtpClient to our server and it will deliver it to recipients using SMTP Relay or some other way that coded inside that software...but, I would like to make it without using SMTP Server software...
Till now I found that I need to discover MX record for recipients domain, so let's say I found MX record for gmail.com (gmail-smtp-in.l.google.com), but how do I send email to that MX Record from my own C# code?
Does System.Net.Mail.SmtpClient suitable for this task?
Where I can find examples of how to do it?
From my previous expirience with SmtpClient, I need to provide SMTP server address (optionaly port), credentials, but in my case, of course I do not have credentials and I'm not sure how to get the correct port (does all servers from MX records has port 25?).
Thanks!
I wrote a windows base application with C# which sends email from a unique address to another unique address every 5 minutes using google smtp. I installed it in 5 Systems of my Company.
It worked for about 500 messages.
today I recieved a "delivery failure" message and it stopped working.
the message was
Delivery to the following recipient failed permanently:
my email address
Technical details of permanent failure:
Message rejected. See http://support.google.com/mail/bin/answer.py?answer=69585 for more information.
I know Gmail blocked my address. but Is there any way to reactive it? I just using two email addresses.
From what I understand, you are using the first email account to broadcast a message, and the second email account to receive those message, which is a lazy way to solve the issue you have at hand and is prone to problems just like the one you've just witnessed. Sending out 500 notifications to a single email address, from a single email address will always raise red flags.
You have two options, you can either carry on using SMTP by using a different service provider and risk service disruptions as well as having your IP being blacklisted or you can create a simple API which the client applications can subscribe to.
I'm a big fan of the email feature available in Backpack, where it creates a unique email address per backpack page, and any emails sent to that address will be posted to the page.
My question is about how best to go about creating new email addresses automatically, and listening for new emails sent to those addresses. I'd like to do this from a C# service (I'm not using ASP.Net)
Has anyone tried to achieve this or
something similar before?
Are there libraries (preferably
FLOSS) already available which do
this or would assist me?
Is it possible to do this using a cloud-based
email service (and if so, what service?) and a
library for communicating with that
service (OpenPop.Net or similar)?
If your email provider supports setting up wildcard email on your domain, then you can do this with a single email account.
For example, Google Apps for Domains allows setting *#example.com to be delivered to myaccount#example.com. When someone emails sales#example.com or contact#example.com it will all be delivered to myaccount#example.com.
Then it's a process of getting all the emails. You then look at the to header in the email, match that with the name stored in your application for that user, and then process however you wish.
Be aware that you will get spam and other incorrectly addressed emails when you use this method. You will have to deal with these yourself (eg by discarding incorrectly mail that isn't addressed to a valid account).
I haven't played around much with incoming mails, but from the top level here is what you should do.
Create email addresses for the users based on any logic and save it in the DB.
Setup a mail server with your domain name and set one email account as a "catch-all" mail account. Any mail sent to your domain would then be caught under that mail account, in case the email address is not found.
Create a windows service, that would read mails from that "Catch-All" account. There are several libraries available to read mails using POP3 or IMAP.
Read the incoming mails to check the email address it was sent to, compare it with the values stored in the DB and process accordingly.
Check this question. it might help you with reading incoming mails.
The objective isn't to create email addresses, that doesn't really happen. What you do is accept email addresses at your system, what you accept is up to you. You could set up a mail server to receive any email sent to your domain, you could then parse the email To field and extract the 'name' portion. If it matches something you are listening for then you action it accordingly.
I don't think you'll find a library for this specific activity as it's rather insular. There are plenty of ways of receiving emails directly or indirectly and processing them in C# but I won't cover that as mail handling in .Net is well documented.