I am trying to add a user suggestions interface to my MVC4 application using system.net.mail .
I want to use my own email address to send mail from me to me with their suggestions. This works fine on debug, but when I publish to a server, Google sends me an email saying I might be a victim blah blah...
Is this just a Gmail thing, or is there a better way to send SMTP mail?
Gmail uses specific algorithms and other relative data to mark a email as spam. In short your email has to have a valid and verified email sender address, authenticated request, etc.
You can check the details of GMail spam detection policy here -
https://support.google.com/mail/answer/1366858?hl=en
we used to use the .net mailer, but now we use mandrill (http://mandrill.com/)
its free for up a certain volume, and certainly for development it serves it purpose without the headaches of the gmail think it's spam, phished emails and what not.
here's a .net wrapper: https://github.com/shawnmclean/Mandrill-dotnet
Related
Sending emails from Exchange Online on behalf of another user seems to be possible from our own domains but what about sending an email with a from address in a completely external domain? Is this completely forbidden by Microsoft or are there some ways to achieve this programmatically?
I am building an app in Xamarin Forms where you can buy products etc. Now I am at the stage where I want to send the user a confirmation when their order has been placed.
I have a string cointaining their email but I am not quite sure how to proceed. When I have previously worked with mail it looks something like this:
Device.OpenUri(new Uri("mailto:ryan.hatfield#test.com?subject=free candy&body=you can trust me"));
And what this does is that you open your own mail and you have to send it yourself to yourself which obviously is wrong.
So my question is, how can I send a confirmation email from my email to their inputted email which I have stored in a string?
You have a few options. If your email is a Microsoft Exchange mailbox, you can use Exchange Web Services (EWS), which is fairly simple if you follow code samples online. Otherwise, you should use an SMTP client. .NET has its own that you can include: System.Net.Mail, or you can find a number of libraries online.
If you're inclined toward the .NET SMTP option, I would take a look at this question. It has a fairly complete example that should help you get started.
EDIT: You mentioned that your backend is PHP-Based. There are plenty of SMTP libraries for PHP as well and plenty of code samples. Here's another SO question I'd suggest you look at to help you get started in PHP instead of C#.
I am developing an MVC 4 app and use the OAuth providers provided by MS, but I would like to get an e-mail address for every user. For Google (default) and Facebook (using FacebookClient) I already get the users address, but what to do about the following:
Twitter (I have read it is not possible - still true?)
Microsoft - solved (see comments)
Yahoo - works (see comment)
LinkedIn - solved via own provider like for MS
And what about, when it is not possible via OAuth like with Twitter?
I've read in different threads it is not good/secure to just ask the user for it. Is it "secure enough" if I also require a verification via e-mail to actually use the address (but not the account in general) as I (will) do when changing the address?
The purpose of OAuth is not to provide email addresses, its to provide authentication in a standardized way. Just because a lot of the implementations also happen to give you the option of an email address doesn't mean that all of them must comply. Twitter is a case in point.
Why would asking a user for their email address not be "secure"?
I would question that, I mean if you can't trust a users input regarding their email address, what can you trust them with? If you're using some sort of confirmation mail system it would surely be fine?
I need to send a secure email to my web site users who are using services like hotmail, gmail, yahoo etc. I am reading about sending secure email via PGP but I am confused it this can be done with users who are using these public email systems ( and not enterprise email systems).
Can someone please elaborate what exactly is the workflow for setting up a secure email? My understading is that we will have to have PKI infra-strcuture on our end and the users will have to install certificates on their machines. Is this correct?
Can these certificates be used with email services like hotmail, gmail etc?
I don't believe there's a way that you can have integrated end to end encryption in most consumer webmail services; I've never seen a provision for public and private keys in any one I've used and my gut feeling is that the computational overhead for doing encryption doesn't make sense to be running on the server. I'd be happy to be corrected on this point, however.
One solution might be to send them a plaintext email asking them to sign into your website to receive the information (provided your website connection is SSL-encrypted). This way, a potential email interceptor only sees that the target has received an email with a link to your website informing them that a message is waiting for them but not explaining the content of the message.
If you're absolutely sure that you want to send them encrypted email using PGP, you could try encrypting the mail on the server with the user's public key and sending it to them and expecting them to decrypt it themselves. However, for that to work you'd have to potentially generate a public/private key pair for the user and inform them of what "their" private key is, which defeats the purpose. In that case, a PKI setup is not the best idea, and a different shared-secret encryption method could be used instead.
Signing your email message automatically is not difficult, but automated signature verification would again rely on the webmail service providing it. Chances are that the users would have to verify the email signature against your published public key.
A perfectly good solution used by a lot of companies is to email the users a link to a secured web server which will then provide the content.
This requires a small element of initial set up for authentication, however it can be used for communication with anyone who can access the Internet via a browser.
I am building a C# application where users creat an account and type their email address,
I know how to validate it with Regular expression, what I am having truble with is how to check if that email actually exist?
i.e. lilush#gmail.com --> is there such email address?
Thanks!
The only way to check this is to send an email to that address and make sure that you send a link that needs to be clicked to activate the account. There is no other way to check if an email is correct
Have a look at EmailVerify.NET
EmailVerify.NET is a powerful Microsoft .NET software component that verifies e-mail addresses with various tools, including:
Advanced syntax verification, according to IETF standards (RFC 2821 and RFC 2822, among others)
DNS validations, including MX record(s) lookup
Disposable e-mail address (DEA) validation
SMTP connection and availability checking
Mailbox existence checking, with greylisting and temporary unavailability support
Catch-all testing
There's only one way to do that: Send an email containing a (unique, of course) link to the address, and ask the user to click the link.
If you wanted to be really fancy you could embed an image in the email as-well. When your server detects that the image was downloaded then you know they opened the email. This also removes the need for the clicking a link thing which many people either don't trust or it doesn't work. Just a thought.