How do I create a contact form that will submit to an email address? The email account will be hard coded and grabbed from a form field to cc sender.
Thanks!!
You'll need the form to submit to a controller action on the server (I'm assuming ASP .NET MVC 2 based on the question's title) which will build and send the email.
There are plenty of tutorials on how to actually send the email. Basically, you use the mail objects from System.Net to construct a message and send it to an SMTP server. Naturally, this means you'll need an SMTP server you can use. Your email provider may or may not have a public one. If not, that's a whole other question.
Related
I have a form on my portfolio that allows a user fill in a form with a question they have and send that to me by email.
When i try to use sendgrid it only allows me as a verified user to send emails from my own email address. but i want the 'from' field to be dynamically filled in by that user and then sent to me.
note: I also tried 'emailjs' but that works fine in development but fails in production.
Any suggestions on how to fix this or any other platforms i can use for that preferabally free since it is a hobby project.
Thanks
Twilio SendGrid developer evangelist here.
You do need to use a verified email address to send emails from SendGrid, this is to stop people using a form like you describe to spoof anyone's email address.
A better idea is to send emails created in your form from a verified email address and set the reply-to address as the submitted email. That way you can send with SendGrid and then when you reply in your email client it will return to the person that submitted the form.
I added more detail and example code (in Python) in this answer.
I'm new in swift programming and I'm working on simple app. However, I was wondering if I can build "Contact us" view controller where the user enters his message and his data sent to me by email. Is it possible?
example:
There are two approaches to send mail from iPhone SDK
You could try MFMailComposeViewController to send an email.
You could set up a web server from where you could send the email with the help of web services.
I’ll suggest building a web service, post this data as a JSON object, make a fancy email at server end and shot it to concerned email id, you have an option to do any additional task.
Like storing a data to db, tagging it specific way and filtering emails from blacklisted email ids.
You can use mail gun or mail trap to help you setup simple way.
I am trying to build app where users can subscribe for new updates.
My mailer is configurated with mailgun. Everything works fine except when I try to add new user with this method (as in official document): http://documentation.mailgun.com/user_manual.html#mailing-lists.
Honestly I have no idea how to send email adress from form directly to add_list_member(mail) without saving it to my database.
I will be grateful for any help!
Create two fields in your form
Name
Email
On Form's submission you send the input from the user to your backend for processing.
The backend takes the form's input, makes a few check to ensure the email is correct and not mispelled.
If the above is successful your backend pushes the email address and name to a mailing list, for reference that's something which you can create with the API or from the control panel (https://www.mailgun.com/cp/lists?domain=YOURDOMAIN.COM)
Then you just email the address provided in the email list
Currently, I am developing a website using Drupal 7 in my local computer.
I have set up Contact Form (Drupal core module) for user to send feedbacks.
However, I have no idea how to send email from Contact form. I didn't receive any email after I filled in and submitted the contact form. And website displays the status "The message has been sent." But there is no email received.
I know there must be something I need to setup before using Contact Form. Maybe mail server?
I use Drupal 7 with XAMPP.
Is there any step-by-step guideline on sending email? Maybe for both cases
Local machine as web server (for testing on my local computer)
Real web server (for publishing after everything is done)
I have searched some solutions in some forums but I do not understand.
I am new to Drupal.
Thank you so much for your help and guidance.
For getting mail from contact form,
Enable the module
Go to admin-> structure-> contact form
Create new category
Fill the details Category, Recipients (you need to give the mail you need to get notified), etc...
If you need to test the mail in local then you need to setup SMTP module in your drupal, this will work in server also.
If you don't have any any SMTP settings then you need to test in server. In server you may don't need any smtp mail, simply php mail may work if your hosting server is support. So no need to do any extra effort for that.
We are developing a contact form for a SaaS application; each instance of our application will have a contact form to contact the instance owner.
Our first version sends email from a generic SaaS email address (i.e. contact#saas.com) to the owner of the instance (i.e. user#example.com).
This works, but of course if user#example.com replies to the email, the answer gets sent to contact#saas.com . I'm wondering what's the best practice here:
Setting the from: message to the email address filled out in the contact form would enable replies to be sent easily to the person who sent the contact form- but then, we cannot tell people to add contact#saas.com to their whitelist to avoid spam filtering
Setting the reply-to header seems better, but I'm wary that some clients will misinterpret reply-to
Including an explanatory text in the message seems inconvenient, but workable
Allowing instance owners to read contact forms through their admin panel seems too much work (but completely spamfilter-proof, albeit inconvenient)
I'm leaning towards 2. Thoughts?
Alex
I'd definitely go for option 2 . From-Header / Envelope-From should make it clear that the message originated at your service (and allow proper bounce handling etc) . I'm not aware of any current mail clients that cannot handle reply-to header correctly. to be on the safe side you could mix in option 3 and clearly state that the message was sent from address sender#example.net via your webform.
Proper whitelists should work if you put the real sender in Sender: and/or the envelope sender; but then again, in an ideal world there would be no Microsoft.