Sending mail without smtp server and credentials in asp.net - 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

Related

Generating an email with a QR code

I am trying to generate QR codes for each of my customers. Each QR code would create an email to me. I've researched and I am pretty sure that I understand how to best create emails with a specific subject and body filled in.
Create the mailto code/script/line that would create the email.
mailto:test#gmail.com?subject=Test%20Subject&body=This%20is%20a%20test.
Create a tinyurl out of the script, to create a more reliable QR code.
http://tinyurl.com/nry2xud
Make a QR code out of it with any standard website. I used http://www.mobile-barcodes.com/qr-code-generator.
This is all fine, but I want the QR codes to mask the sender's email address. I do not want to get an email from a personal email account that the customer has on their phone. I want to replace their email address with the company address that the specific customer works for.
Is this possible? Thank you for any help you can give.
By definition, mailto uses whatever mail client is configured in the user's browser, and sends from their own email address. (From the spec: "Originator fields like From ... when present in the URI, MUST be ignored.")
If you have a web server somewhere, a better solution would be to avoid mailto entirely. Instead, have the QR code direct the user to a page on your server. The server script for that page (written in, say, PHP) would send you the email. Then, it would also serve up a confirmation message to the user.

ASP.net send password on Email Address

I have searched about how to do password recovery in case user forgot password but everywhere i have seen people have coded only for g mail , i need example in which all mails are done or some type of general code is written to do that. I want to take user Email as input and send his password on his mail inbox.
Thanks in advance.
Sending e-mail works exactly the same independent of the user's e-mail provider. It's a standard protocol. How did you arrive at the conclusion that the code you've seen online only works with GMail?

sending mail to any website using java servlet

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

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