Rapid Subscribe Android App

Rapid Subscribe Android App
Rapid Subscriber

Recent Posts

How to Send Email in Android app using Intent | Contact us Form in Android app

How to Send Email in Android app using Intent | Contact us Form in Android app


In this post, we create a Contact Us form in the Android App. We create 2 Edit text and a Send button to send email in the android app.

We get a subject and message from our app and pass it to the email client.

Create 2 EditText and a Button in activity_main.xml

activity_main.xml
 <?xml version="1.0" encoding="utf-8"?>  
 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
   xmlns:app="http://schemas.android.com/apk/res-auto"  
   xmlns:tools="http://schemas.android.com/tools"  
   android:layout_width="match_parent"  
   android:layout_height="match_parent"  
   android:orientation="vertical"  
   tools:context=".Contact_us">  
   <EditText  
     android:layout_width="match_parent"  
     android:layout_height="wrap_content"  
     android:hint="contact@harpreetstudio.com"  
     android:enabled="false"  
     android:padding="10dp"  
     />  
   <EditText  
     android:layout_width="match_parent"  
     android:layout_height="wrap_content"  
     android:hint="Subject"  
     android:id="@+id/email_subject"  
     android:padding="10dp"  
     />  
   <EditText  
     android:layout_width="match_parent"  
     android:layout_height="wrap_content"  
     android:hint="Message"  
     android:maxLines="4"  
     android:padding="10dp"  
     android:id="@+id/email_message"  
     />  
   <Button  
     android:layout_width="match_parent"  
     android:layout_height="wrap_content"  
     android:text="Send"  
     android:id="@+id/email_send"/>  
 </LinearLayout>  

Now, we create an Intent to send values to Email client in you Android.

MainActivity.java
 package studio.harpreet.sampleproject;  
 import androidx.appcompat.app.AppCompatActivity;  
 import android.content.Intent;  
 import android.net.Uri;  
 import android.os.Bundle;  
 import android.view.View;  
 import android.widget.Button;  
 import android.widget.EditText;  
 import android.widget.Toast;  
 public class Contact_us extends AppCompatActivity {  
     EditText et_subject,et_message;  
     Button btn;  
   @Override  
   protected void onCreate(Bundle savedInstanceState) {  
     super.onCreate(savedInstanceState);  
     setContentView(R.layout.activity_contact_us);  
     et_subject = findViewById(R.id.email_subject);  
     et_message = findViewById(R.id.email_message);  
     btn = findViewById(R.id.email_send);  
     btn.setOnClickListener(new View.OnClickListener() {  
       @Override  
       public void onClick(View v) {  
         String subject = et_subject.getText().toString().trim();  
         String message = et_message.getText().toString().trim();  
         String email = "contact@harpreetstudio.com";  
         if(subject.isEmpty())  
         {  
           Toast.makeText(Contact_us.this, "Please add Subject", Toast.LENGTH_SHORT).show();  
         }  
         else if(message.isEmpty())  
         {  
           Toast.makeText(Contact_us.this, "Please add some Message", Toast.LENGTH_SHORT).show();  
         }  
         else  
         {  
           String mail = "mailto:" + email +  
               "?&subject=" + Uri.encode(subject) +  
               "&body=" + Uri.encode(message);  
           Intent intent = new Intent(Intent.ACTION_SENDTO);  
           intent.setData(Uri.parse(mail));  
           try {  
             startActivity(Intent.createChooser(intent,"Send Email.."));  
           }  
           catch (Exception e)  
           {  
             Toast.makeText(Contact_us.this, "Exception: "+e.getMessage(), Toast.LENGTH_SHORT).show();  
           }  
         }  
       }  
     });  
   }  
 }  

 
Follow us for more posts like this, 
Subscribe to Harpreet studio on Youtube  
Like Harpreet Studio on Facebook  
Follow me on Instagram 

29 comments:

  1. Android App Maker makes it easy to create an app of your own. Cyberflix APK

    ReplyDelete
  2. Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Thanks email extractor 9.0

    ReplyDelete
  3. I have read your article couple of times because your views are on my own for the most part. It is great content for every reader. how to send customized email from gmail

    ReplyDelete
  4. I admire this article for the well-researched content and excellent wording. I got so involved in this material that I couldn’t stop reading. I am impressed with your work and skill. Thank you so much. spacedesk

    ReplyDelete
  5. Deciding on a brand name is one of the common mistakes of startup companies. Having names that is thoroughly thought off is an edge that can lead your company to success. Email Extractor

    ReplyDelete
  6. Good to become visiting your weblog again, it has been months for me. Nicely this article that i've been waited for so long. I will need this post to total my assignment in the college, and it has exact same topic together with your write-up. Thanks, good share. https://satta-king.center/

    ReplyDelete
  7. The seller stamps his name in the clear space under "Request Form" and mails them to forthcoming clients. At the point when he gets requests (and he will in the event that he mails them consistently), he keeps his bonus, which is generally about half.

    ReplyDelete
  8. This is important, though it's necessary to help you head over to it weblink: LinkedIn Profile Scraper

    ReplyDelete
  9. Thank you so much for ding the impressive job here, everyone will surely like your post. best remote access tools

    ReplyDelete
  10. iPhone Facebook app development has changed the scenario of the smart phone. The social networking site has been remodeled by the iPhone Facebook apps developer to give you all the applications with their complete view and full functionality. spotify++

    ReplyDelete
  11. Shockingly, relatively few clients comprehend or set aside effort to check what authorizations they award. AFK Arena Codes

    ReplyDelete
  12. However these applications were at that point a piece of many advanced cells that preceded Android, these were costly sufficient that not every person had the option to manage the cost of them. With the presentation of Android controlled PDAs and tablets on the lookout, this whole scope of very good quality games just as applications turned out to be more available to the normal masses. walkie talkie long range

    ReplyDelete
  13. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. android programming wallpapers

    ReplyDelete
  14. Thanks for sharing this valuable content. In my view, if all webmasters and bloggers made good content as you did, the web will be a lot more useful than ever before. what is iot hidden menu

    ReplyDelete
  15. I really loved reading your blog. It was very well authored and easy to understand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he enjoyed it as well!
    english stories

    ReplyDelete
  16. Solid Email Subject Lines
    Solid headlines are the mystery ingredient of email advertising. It's the primary thing individuals see when they open their inbox-an initial feeling of your substance. gmx login

    ReplyDelete
  17. This can assist with setting up that you are the business to go to for a specific item or administration. gmx net

    ReplyDelete
  18. Address : 33 Chester Road West, Deeside, CH5 1SA

    Phone : 0203-858-0302

    Capital Services Group was created with one mission in mind: to provide tailored solutions designed to resolve all your servicing needs. Our team of dedicated specialists are committed to providing the highest quality service every time. Rest assured that no matter the service your needs are in safe hands.
    Commercial Cleaning Company




    ReplyDelete
  19. What is an SMM panel?
    An SMM panel is an online shop that offers SMM services at affordable prices.smm panel Provider

    What kinds of SMM services do you provide here?
    There are many types of SMM services available on our panel: likes, followers, views, etc.

    Are SMM services on this panel safe to buy?
    Our SMM services are totally safe to use, you won't lose your accounts.

    A mass order — how does it work?
    You can place multiple orders with different links at once using the mass order feature

    What is Drip-feed?
    Grow your accounts as fast as you want with the help of Drip-feed. How it works: let's say you want 2000 likes on your post. Instead of getting all 2000 at once, you can get 200 each day for 10 days.

    ReplyDelete
  20. Address : Alfred-Escher Strasse 66, 8002 Zurich

    Phone : +41 44 280 29 29

    After many years of dreaming to have this first barbershop, it has finally come true. We are proud to announce that “The Good Barbers” has opened its doors for the first time at Alfred-Escher Strasse 66, 8002 Zürich, and this marks the beginning of our story.

    This dream involved many conversations, research and experience gained by working in some of the best barbershops located in Madrid, London and Zurich. We come from a family of entrepreneurs and have always had in mind that we should be taking risks whilst carefully deciding what the best business concept should be for this city that we call home.

    We were clear that this business should be built with the following core foundations:

    - Tailored experience

    - Special care for the hygiene

    - Relaxing environment

    - Quality service, products and infrastructure


    With that in mind, one of the most important next steps was to find the first location for our business, we wanted it to be in the city, with good light and in a vibrant area. This search was found to be very challenging as we were not able to offer to the landlords any past record of us being successful as a company, and therefore it was the step that took us the longest to achieve. Thankfully, our chance arrived, and we were able to find a dream location for our business, it had everything we were looking for and more! Two stories, corner location, business hub, floor to ceiling windows…

    Once we were told we got this property, it was time to celebrate! But most importantly, it was time to start bringing to life all these concepts we had been discussing, creating, and modifying throughout these years. Thanks to all the preparation work we did; it was clear what the next steps were and how to execute them.

    Not to bore you with many details, but just to name a few of the concepts we had to now bring to life: furniture, company creation, suppliers, point of sale, software, webpage, talent… It took us many hours of thinking and execution, but we had a goal in mind all along, and it was to open our doors on March 1st, 2022. With project management skills, help from our loved ones and huge amounts of effort, we finally made it! And what a joyful moment it was to see the first client going into the barbershop the first day…


    We would like to take this opportunity, in our first blog post, to thank all of you who have supported us through this journey and also to all our clients who have been coming in or are planning to do so, and therefore giving us a chance. We know it’s challenging to trust a barbershop that has just opened with your hair, beard and facial needs and therefore why we are especially thankful to all of you.

    For any new customers, there is a ongoing offer of 15% discount in your first booking when done online. This offer lasts until 15th April 2022 and includes all services we offer. Definitely an offer not to miss out and that hopefully will bring an extra incentive to you for trying us out. We will do our best to give you a unique service experience in the best barbershop environment you will find in town.

    This is just the beginning of our dream, and we would love to continue sharing it with you all via our 1:1 appointments, social media (Instagram: the_good_barbers / Facebook: thegoodbarbersag) and through this blog.

    Your barbershop of reference in Zürich,

    The Good Barbers.

    Hair Products for men

    ReplyDelete
  21. Address : 109 W 39 St #Concourse 1, New York, NY 10018

    Phone : +1 (646) 781-7070

    Avail Unparalleled Locksmith And Security Services In NYC NYC Security Systems Company
    Established in 2010, Top Notch Locksmith & Security in NYC is a well-reputed family-owned business. We pride ourselves on offering a wide array of locksmith and security services solutions to both residential and commercial clients throughout the New York City area, including Manhattan, Brooklyn, Queens, and The Bronx. Our vast list of services includes all locks and lock systems, intercom installation and repair, buzzer systems, access control systems installation, closed-circuit TV installation, and so much more. Regardless of the service you choose, our well-trained staff is sure to give you the best service experience you have ever had in the locksmith and security industry.

    At Top Notch Locksmith & Security Services, we strive to be industry leaders in our domain. Our core focus lies on providing professional, reliable, and efficient locksmith and security services under one roof. We offer a vast portfolio of services, catering to different problems, to make sure that the diverse needs of our customers are met. At Top Notch Locksmith & Security, we have spent the last decade working tirelessly to associate our name with quality service and high levels of customer fulfillment. From residential locksmith and security issues to large-scale commercial services, we value each project equally and prioritize results and customer satisfaction over everything else. Dedication to our valued customers, commitment to premium workmanship, and an unrelenting passion for pursuing the newest technology trends are what make Top Notch Locksmith & Security stand out from the competition.

    ReplyDelete
  22. Address : 260 Madison Ave 8th Floor #8001, New York, NY 10016

    Phone : +1 718-213-8508

    Medebound HEALTH Medebound HEALTH is an international healthcare company that is incorporated and headquartered in New York, and has its operations in North America, and Asia Pacific. It is dedicated to assisting patients across the globe to gain easy access to top medical experts and advanced treatment methods when they encounter frustrating and devastating conditions. Medebound HEALTH has contracted with the world’s largest insurance firms (global Fortune 500 companies) and has successfully acquired worldwide members touching over two million lives, bringing new hope to patients who would otherwise have to travel abroad for care.


    Business Email : support@medebound.com

    Follow on :

    Linkedin : https://www.linkedin.com/company/medebound-llc/

    ReplyDelete
  23. Address : Currys Post Road, Nottingham Road, KwaZulu-Natal, 3280 South Africa

    Phone : +27 83 391 5505

    CONGRATULATIONS ON YOUR ENGAGEMENT!
    You’re engaged, high on love and feeling excited!
    Then the mind starts: Everyone wants to know everything – from the wedding date to the bridesmaid dress color.
    It’s easy to feel a little overwhelmed at this stage, but we are glad to see that you have taken the first step and started your venue search!
    There is no mistake that our paths have crossed. You wanted something special? You found it.

    Wedding Venue


    Combining a premium boutique Bed and Breakfast with a magnificent three tiered country wedding venue – you are not simply hiring a wedding venue,
    but partnering with us to create a series of memorable moments resulting in a remarkable experience to be remembered.

    THREE MAGNIFICENT INTERCONNECTED VENUES
    Our venue rental includes the exclusive use of three magnificent venues which dovetail together to create the perfect wedding day.

    The Ceremony, Reception and After Party are all interconnected separate spaces – each space holding it’s own majestic look and feel creating multiple wonderful experiences for your family and loved ones throughout your special day.

    ReplyDelete
  24. Address : Room B8, 1/F, Block B, East Sun Industrial Building,16 Shing Yip St, Kwun Tong, Kowloon, Hong Kong

    Phone : +852 5448 6841

    We first started just as a lattice shop in Hong Kong. If you don't know what that is, it simply refers to a small area divided from the shelf , and we owned one of them.


    We were small, but we were serious about finding reliable suppliers.


    It wasn't plain sailing. Spammers, overpriced or expired products, inauthentic items, orders that took forever to ship, irresponsible outsourcing partners, dubious companies... you name it, we have experienced them all.

    Beauty Retailer & Wholesaler


    So we thought, why don't we build our own trustworthy one-stop beauty platform? Not only for our retail customers but also those businessmen who are serious about finding reliable wholesalers as we did.


    And here we are, Carsha.

    Our Mission
    We aspire to build an all-in-one beauty marketplace for our retail customers by gathering together a diverse range of products, from global-leading brands to indie beauty brands. Towards our B2B customers, we aim to become their most transparent, accessible, best-price and supportive beauty wholesaler.

    Our Vision
    Our goal is to provide our customers with a personalized, informative, and supportive shopping and purchasing experience. We also empower people, including our employees and companies of all sizes, to achieve beauty, confidence, and success. Finally, we hope that Carsha can evolve alongside the rest of the world.

    Our Promise
    We guarantee that we treat you just like how we treat ourselves - that means that all our products will be 100% authentic. On top of that, our collections will expand from day to day to assure you to be able to find the most suitable cosmetics, skincare products, or fragrances for you and your business. Last but not least, our customer service will remain the best all the time.

    Our Impact
    Over 1500 customers were able to save money thanks to our beauty deals. Over 100 businesses benefited from our products and were inspired by our one-of-a-kind and personalized business strategies. More than 20 employees benefited from our environment and learned from us. In the future, we hope to give back to society by focusing on orphanages, homelessness, and mental illness.

    ReplyDelete
  25. Address : 20120 Paseo Del Prado, Walnut, CA 91789

    Phone : +1 401-261-2809

    Pets are waggy-tailed, yappy-or-purry, love-you-unconditionally, furry family members. They chew, poop, shed on the couch, and leave pawprints on your heart. Pets enrich our lives and bring us infinite joy – so they deserve to be spoiled with stylish, superior quality products!

    As pet owners ourselves, Ultra Joys Pets we want only the best for our beloved fur babies. We love to make our dogs and cats look fancy with cute accessories! But we also know that safety is important when our pets are out exploring the world. If you share your life with a dog or cat, you’ll understand our dilemma and have probably been seeking a solution.

    So we poured our passion into creating fun, functional pet products that keep animal companions safe and stylish. In 2018, we established Ultra Joys Pets, to give pets and their devoted owners the quality they deserve. From modern collars and leashes to personalized pet ID tags, our products are handmade with love and customized in Southern California.

    Naturally, we’re here to please you as well as your pet! We take care to process orders quickly and pride ourselves on delivering 100% customer satisfaction. Buy from Ultra Joys Pets and both you and your fur baby will benefit!


    Hours: Mon-Fri 9am - 5pm PST.

    Established: 2018

    Keywords : dog tags, dog collar, ultra joys pets


    Follow on :

    Facebook : https://www.facebook.com/ultrajoyspets

    Instagram : https://www.instagram.com/ultrajoyspets/

    Youtube : https://www.youtube.com/channel/UCo3heDWJsJprXkdhb3zmocg

    Pinterest : https://www.pinterest.com/ultrajoyspets/

    ReplyDelete
  26. Thanks for taking the time to discuss that, I feel strongly about this and so really like getting to know more on this kind of field. Do you mind updating your blog post with additional insight? It should be really useful for all of us. Mobile App Development Company in India

    ReplyDelete
  27. The accounting job outlook is by no means bleak. Now inside your companies have a true requirement of qualified individuals that will help them streamline their budgets as well as prepare audits, taxes and other unavoidable regions of business. In truth, this career choice is projected to check out continued growth at a rate that may be way quicker than average. phone verified accounts

    ReplyDelete
  28. Address : 429 S. Evergreen St., Bensenville, IL 60106

    Phone : +1 630-616-9999

    Fax : +1 630-616-5509

    We manufacture our own kitchen cabinets under the brand name “American Wood Cabinets.”

    Marble countertops

    Factory Plaza has earned a solid reputation for providing excellent quality and customer service.

    We are committed to the communities in which we operate making every effort to bring quality and affordability to each and every household. Here, at Factory Plaza, our customers are our neighbors, our friends, and our business partners.

    Our best assets include our experienced and knowledgeable employees, craftsmanship, and unparalleled customer service.

    ReplyDelete
  29. I want to thank you for sharing such a good information that provides you, that's great. online sattaking

    ReplyDelete