Mail from server going to junk folder - c#

I am working on an ASP.NET website. I have a page where I'm sending mail. Here the user adds the recipient; the sender is his own id. When I run this application on my location machine the mail properly comes in my inbox but as I paste that page on the server and try mailing the mail comes in Junk folder.
Can somebody please help me out?

Check if your Sever IP is added in Relay list of SMTP server.

This doesn't sound like it has anything to do with code and more about setting your SMTP servers up properly in the realm of DNS and/or discussing it with your hosting provider. According to your post, your ability to send mail is not the issue - its more about how the receiving agent treats your email (tags it according to some rule, etc.). The only difference being "who" sends the email (your local machine, vs your server).
There are Postmaster resources - this one from everyone's favorite- AOL that you may find useful. You can also check with DNS blacklists if your server's IP is (unfortunately) listed.

Related

SQL Database Mail- status sent but never receiving email on Microsoft email

I have a problem with Database Mail on SQL Server Enterprise (64-bit), Windows Server Standard 2016. If anyone who can help, I would very appreciate.
The problem is:
I moved my Data to a new server (using 1and1 server). I am using 1and1 email (ionos.co.uk) to setup Database Mail and I can send email from Database Mail to any email provider except hotmail, outlook mail. the status on sysmail_allitems is "sent"
I did setup the same way for my old server, it was working fine.
I don't know why only hotmail, Outlook mail can not receive my email.
Server: smtp.ionos.co.uk
Port: 587
I also opened all the security port for mail on firewall network and firewall server.
Thank you very much.
UPDATE: As of yesterday January 26th, 2021 according to Ionos/1and1's posted notice, and corroborated by my personal email sending experience having been remedied, the issue has, indeed, been resolved.
There is actually a huge issue going on as of a few days ago specifically between Ionos/1and1 & Microsoft (i.e. Hotmail, Outlook) preventing emails from being sent. Here's Ionos/1and1's status update page on the issue:
https://www.ionos-status.com/
And you can also see another thread talking about other users experiencing the same problem here:
https://answers.microsoft.com/en-us/msoffice/forum/all/messages-not-being-delivered/e24bf21b-01f7-4ef4-bfbf-b24bea75aad0
It's possible, that a very recent hack involving Microsoft and an Ionos-based server might just be involved with Microsoft employing mitigating methods of addressing the issue which are now leading to the current email sending limitations. You can read about the hack here: https://amp.thehackernews.com/thn/2021/01/hackers-accidentally-expose-passwords.html

how to know the different status of sended email in c#

I am Creating an application in c# . I have to know how can I know the status of the sended email.The status May be.
4. Track sent emails to determine if they were:
4.1 delivered
4.2 opened
4.3 recipient opt-out
4.4 bounced (with the reason for the bounce)
4.5 time/date sent
4.6 which links in the email were clicked (and time/date they were clicked)
4.7 IP address, if user clicked any links in the email
Should I use Any API or Dll or something else.Please help .Any Help will be Appreciated.
If you program your application to send mail through a hosted SMTP server like http://www.sendgrid.com or http://www.ultrasmtp.com, you can access the delivery status of messages that you've sent.
There is no easy way to do what you want. Actually this status can be tracked by your SMTP server itself and if you are using some third-party SMTP server like GMail or any corporate server, I 'm afraid they won't give you access to those information without using a authenticated client.
From your C# program, if the SmtpClient.Send() method returns true, you can assume the mail has been delivered to the SMTP server. If in case, the delivary fails, you should receive a mail to the outbound mail ID's inbox. If you want to make outbound mails appear in your outbox, you should configure IMAP/POP3 configurations accordingly.
There is no API or DLL available in exact form you want, as far as I know. You can try some other way like tracking a hash or embedded image in the mail-body from your server. But these are not reliable way as most mordern Messaging services have counter-measures for this.

Sending Email-SMTP Problem-C#.NET

I am struggling with this problem from yesterday.
What I have done so far?
I have used the code to send an email using local smtp server. Code is(C#.Net) Here.
I can telnet the localhost on port 25.
When I telnet: "220 DomainName Microsoft6 ESMTP Mail Service, Version 6.0.3790.3959 Ready at Date Time "
When I try to send the email, there are no errors in the code and code gets executed successfully without any error.
Errors:
When I check in the eventviewer, the error is : Message Delivery to Host 74.125.159.27 failed while delivering to the remote domain gmail.com for the following reason. The remote server did not respond to a connection attempt.
I know there is error in my SMTP Server Setup, I have not set it up properly. How do I Trouble shoot it.
I have downloaded a smtpdiag.exe from microsoft but, It doesn't do anything when clicking on .exe file loads up and disappears.
Resolutions Please?
Please help me how do I troubleshoot it. If you need more information please ask me, I will provide but try to help me
Thank you.
You are sending emails through IIS SMTP Server right?
And you are sending to your gmail address?
How OFTEN do you send them? Google as a kind of spam protection that fakes that the servers is not responding if an IP address tries to send too many emails at once.
There is a thread here at SO about it. But I can't seem to find it.

Send mail from C# application not really working?

I have an email application where a user can fill out a form and the info get's mail to the form admin. I have the correct server and email credentials being set and i do not get any errors when the mail is sent. The To and From addresses are the same (admin#thedomain.com) It is like the mail is somewhere in limbo. I know the email account works, because I send mail to it from outlook. Any thoughts?
update:
Regarding code, I have created an abstraction to the System.Net.Mail.SmtpClient class. I can set another server and the code works. The server that does work is within my host’s network. The server that does not work is outside of the network. Strange thing is, like I said, I can setup the account in OutLook and I can send / receive mail fine. I’ll have to check with my vendor to see if the mail is indeed getting to their server.
My guess is permissions. Can your app send an email to your address?
I believe .net's system.web.mail sends email via relay. You need to check with your email admin to determine if your IP address is allowed on the server to relay mail.
It turned out to be a DNS issue with my hosting company. I could send mail via outlook becuase I was direclty connecting to the mail servers. The MX records were screwed up. Thanks to all who looked

How do I test my email settings without sending a message?

As part of my app's config process, I have a sanity checker that validates all user-supplied data. This includes email server settings that the app uses to send email.
I'd like a simple sanity check on those settings without actually sending any email. It'd be great if this could support all standard flavors of SMTP setups including those with authentication/ssl/etc.
It doesn't need to be exhaustive but the more coverage, the better.
Currently all I do is verify I can open a connection to the given server on the given port. Something a little deeper would be nice.
Note: I'm not trying to validate email addresses--that's not relevant to this question.
You just open a raw connection to the server & port that the user supplies and do a
HELO Server.Domain.Com
Mail From: validaccount#domain.com
to see if you get a valid HELO response & Sender OK Response
(if smtp authentication is enabled).
Same as you would do if you telnet direct to the server.
http://www.petri.co.il/test_smtp_service.htm
This might also be useful
http://qmail.jms1.net/test-auth.shtml
I'm sure someone brighter and more qualified will pipe up with a better answer. However, at first blush I'd say that you cannot verify the ability to successfully send email without actually sending an email.
However, if you want to automate the process, you can have a 'MyApp_SanityCheck#gmail.com' (or your local domain) address.
Then you can create a watchdog application that monitors that email address, or just a simple app which programmatically interfaces with that email address and checks if an email was received within X minutes. This way you can be 100% certain that the emails are able to be sent out.
This link shows how to programmatically check gmail addresses.
An important note: If you application is sending out external emails, then it would be best if the email address you use is external, because it is possible that your server could be unable to send external emails, but internal emails go through just fine, and in that case your sanity check would send up a false positive.

Categories

Resources