Send E-mail without using SMTP in Asp.net - asp.net

My website uses ASP.NET to send emails, but my school's network administrator has blocked the SMTP port and services. After I visited the p2p forums I found a suggestion to use web service to send email, have you any suggestion which website would provide web service for sending emails?
I tried to use System.Web.Mail.MailMessage class to send the emails through my program, but it also fail. Anyone can help me to solve this problem? I need your help. Thank you!

You can use SendGrid.
They offer a webservice and you can send up to 200 emails a day with a free account.
They have code samples for several languages: https://github.com/sendgrid

I think Email sending with ASp.net has nothing to do with blocking of your smtp port and service of school.
You can use gmail's smtp server for sening email in your application/
SMTP URL HOST : smtp.gmail.com,
IS SSL Enabled : true,
PORT: 465,
USERId:your_username#gmail.com,
Password: Your_Password

Use Gmail, Yahoo or other Email providers to send a mail.
Please refer my answer #CodeProject - sending email to gmail from asp.net, if you want to use Gmail.
Also follow - Send Email from Yahoo, Gmail, Hotmail (C#).

Well that depends, if you are talking about the SMTP port of your network, then you can still use Gmail, Yahoo, Outlook or other ports, all you will be needing will be just a username and password alongwith the port (that must be 25) and the server address (for gmail it is smtp.gmail.com).
But if you are talking about Sending emails without using SMPT. Its not possible, with or without ASP.NET.
However, you can try using SmtpSettings for ASP.NET.
There are some other issue too. Please checked that the SmtpServer that you are using (gmail, yahoo etc) are allowed, because if they are blocked too, you would have to search for something new.
And yes, there are some other servers too. Like free email providers that would also let you use 200emails/day for free or something like that. You can check that out.
You mentioned you are using System.Web.Mail.MailMessage, here is an msdn blog post about setting the Smtp for that: http://msdn.microsoft.com/en-us/library/system.web.mail.mailmessage.aspx

Related

Send mail via SendGrid to Outlook was always failing

I am a newbie in using SendGrid. I have a web application that send a mail to users after the successful registration. I am using send grid to send mails.
It works fine when I try to send Google email accounts. But when I send mails to Outlook email addresses, it always failed to deliver emails.
I checked the SendGrid 'Activity' section it shows like below.
You might need to setup domain authentication. This link should be a good place to start: https://sendgrid.com/docs/ui/account-and-settings/how-to-set-up-domain-authentication/
Outlook might have different firewall rules blocking incoming (potentially malicious) emails while GMail might have a different set of them.

phpmailer SMTP with STARTTLS encryption

would anyone know if it is possible to run phpmailer with STARTTLS encryption?
The story: an online order form that sends the output to both the site visitor and site owner. The goal is that the visitor receives an email from orders#ownerdomain.com, while the site owner receives an email from visitor#somedomain.com (the address that the visitor has filled i the online form).
I have the phpmailer running fine with my Gmail account, using TLS on port 587. I would, however, like to use mailbox provided along with the hosting (so that the from/replyTo looks professional, no freemail). Unfortunately, the hosting provider does not provide TLS - in their knowledgebase they only mention STARTTLS. I tried all combinations of SSL, TLS and STARTTLS for encryption and 465 and 587 for ports with no success.
Would anyone know if STARTTLS is somehow achievable, please?
My plan B would was to use the Gmail SMTP credentials and then tinker with addReplyTo, setFrom and addAddress in the phpmailer SMTP settings. I tried but if I use...
$mail->addReplyTo($_POST['customeremail'], $_POST['customername']);
...the from email address the site owner receives is that of my Google email - I understand this may be some Google email spoofing protection, which just doesn`t allow the SMTP to send an email with the From address taken from the form. - please see the attached ![Thunderbird screen( image: imgur.com/a/1f6vY).
Can this be possibly overridden?
I mean, with that plan B solution, I can grant Google access to send emails on behalf of orders#ownerdomain.com, that`s all fine, it will then mimick the professional domain address. But I cannot do the same for the visitor address (taken from the form), that makes sense, right?
Thanks a bunch in advance...
Yes, PHPMailer does TLS encryption by default. Look at the SMTPSecure property for more details.
Gmail does indeed prevent you from setting arbitrary from addresses, though you can pre-set aliases in your account. This is mentioned in the PHPMailer docs and has been covered many times on here.

How do I send SMTP mail from a Azure website?

I'm using the smtpclient class to send email from my asp.net website hosted on Azure in the 'shared' setup. Everywhere it says that port 25, and ALL ports are open on the Azure servers. My code works from my onw pc, but when published on Azure, it breaks. I am using gmail port 587 secure smpt and I get the error System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1 Authentication Required.
Any ways to get around this? (Without installing a vm with Exchange on it, like ocme on, it's a simple email message).
You are getting that error because of these two possible reasons:
You are using the SMTPClient of Gmail and you are passing the EmailId of some other website like Yahoo/Hotmail etc.
EmailId you are using is not authenticated, you need to provide your mobile number to authenticate your Email Id.
If you are using Yahoo/Hotmail then you can refer to this article which I had created on http://www.c-sharpcorner.com/
http://www.c-sharpcorner.com/UploadFile/cd7c2e/send-bulk-email-from-yahoo-and-hotmail-using-Asp-Net/

How can I use ASP.Net to send email through Yahoo! or Hotmail?

Is it possible to use ASP.Net to send email through Yahoo! or Hotmail? If so, how would I accomplish this?
You can send it just like you would with any other mail host. Using the SMTP client class. It is part of the System.Net.Mail namespace.
You just need to be sure that you get all of the proper connection information.
+1 to Mitchel who beat me to it. Here's some relevant links:
IMAP settings for Yahoo, Hotmail and Gmail:
http://www.emailaddressmanager.com/tips/mail-settings.html
Video on using MailMessage in asp.net:
http://www.asp.net/learn/videos/video-416.aspx

How do I configure TFS to work with GMail to send TFS Alerts?

Environment: Windows Server 2008, IIS 7.0, TFS 2008
We run Google Apps for email and I'm having a heck of time setting up TFS to send alerts to our Google hosted mail.
I googled around and found a couple of workarounds however none have worked for me. Any pointers graciously accepted.
Have you tried setting up an SMTP server on the same box as TFS, then configuring it to forward to GMail? That sounds like the easiest solution.
Alternatively, you could write a SOAP endpoint that handled TFS events with as many customizations as you want. This is a little more work but a lot more flexible.
I just ran through this problem in TFS-2013.
I think the root of the problem is that Apps must sign into Google Securely. For secondary apps, that means oauth. For those that can't, Google needs "Application Specific Passwords". Since it can't really trust the email application, it requires you to generate a random password for that specific account.
The solution for me was:
Enable Email Alerts
SMTP Server: smtp.gmail.com
port: 587
SSL Required: Yes
send from: email#mydomain.com
authentication:
username: mygmail#gmail.com
password: RANDOM APP PASSWORD
Can't you just configure TFS to send outgoing email through the Gmail servers?
http://msdn.microsoft.com/en-us/library/ms400808(VS.80).aspx
Does that not do what you need, or am I missing part of the question? We're using a local SMTP server to send email out, but I don't see a reason why you couldn't use a remote one instead.
I verified that WernerCD AppPassword solution works.

Resources