Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6674425
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:44:37+00:00 2026-05-26T03:44:37+00:00

I recently wrote a texting program (texting through email, rather), and I’d like to

  • 0

I recently wrote a texting program (texting through email, rather), and I’d like to make it more useful than it currently is … at the moment its nothing more than a spam program, although in my defense the default value for the amount of texts is 1. Anyways … instead of having the user enter a phone number, would it be possible to have my program open a dialog box that allowed the user to select from a list of contacts saved somewhere on windows? (Does this even exist? Outlook contacts maybe?)

Below I’ve provided the code that I have up to this point.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Net.Mail;

namespace TextingThroughEmail
{
    public partial class Form1 : Form
    {
        // message elements
        MailAddress mTo = null;
        MailAddress mFrom = new MailAddress("{You ain't seeing this either.}","<< Your Imaginary Friend >>");
    private string mFromPassword = "{lol, you ain't seeing this}";

    public Form1()
    {
        InitializeComponent();
    }

    private void Form1_FormClosing(object sender, FormClosingEventArgs e)
    {
        var result = MessageBox.Show("Are you sure you want to quit?", "Exit", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
        if (result == DialogResult.Yes){ }
        else { e.Cancel = true; }
    }

    private void ExitButton_Click(object sender, EventArgs e)
    {
        Application.Exit();
    }

    private void SendButton_Click(object sender, EventArgs e)
    {

        //This section will retrieve data from the combo box.
        EmailInfo data = (EmailInfo)Carrier.SelectedItem;

        //This section goes through the PHONE NUMBER and validates it            
        long number1 = 0;
        bool canConvert = long.TryParse(PhoneNumber.Text, out number1);
        if (canConvert == false)
        {
            MessageBox.Show("Please enter a valid 10 digit phone number", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            return;
        }

        if(PhoneNumber.Text.Trim().Length != 10)
        {
            MessageBox.Show("Please enter a valid 10 digit phone number", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            return;
        }

        //Vaidation for the message section
        if (Message.Text.Trim().Length > 160)
        {
            MessageBox.Show("Please shorten your message.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            return;
        }

        mTo = new MailAddress(PhoneNumber.Text + data.EmailAddress, "");
        MailAddress mTo2 = new MailAddress(PhoneNumber.Text + "@txt.att.net", "");
        MailAddress mTo3 = new MailAddress(PhoneNumber.Text + "@vtext.com", "");
        MailAddress mTo4 = new MailAddress(PhoneNumber.Text + "@tmomail.net", "");
        MailAddress mTo5 = new MailAddress(PhoneNumber.Text + "@messaging.sprintpcs.com", "");

        //The mail message setup
        MailMessage message = new MailMessage(mFrom, mTo);
        message.Subject = Subject.Text;
        message.Body = Message.Text;

        //messages for Unknown
        //At&t
        MailMessage message2 = new MailMessage(mFrom, mTo2);
        message.Subject = Subject.Text;
        message.Body = Message.Text;
        //verizon
        MailMessage message3 = new MailMessage(mFrom, mTo3);
        message.Subject = Subject.Text;
        message.Body = Message.Text;
        //t mobile
        MailMessage message4 = new MailMessage(mFrom, mTo4);
        message.Subject = Subject.Text;
        message.Body = Message.Text;
        //sprint
        MailMessage message5 = new MailMessage(mFrom, mTo5);
        message.Subject = Subject.Text;
        message.Body = Message.Text;


            //smtp stuff
            SmtpClient client = new SmtpClient();
            client.Host = "smtp.gmail.com";
            client.Port = 587;
            client.EnableSsl = true;
            client.DeliveryMethod = SmtpDeliveryMethod.Network;
            client.UseDefaultCredentials = false;
            client.Credentials = new System.Net.NetworkCredential(mFrom.Address, mFromPassword);

            long j;
            canConvert =  long.TryParse(NumberOfTexts.SelectedItem.ToString(), out j);

            try
            {
                if (Carrier.SelectedIndex < 4)
                {
                    for (int i = 0; i < j; i++)
                    {
                        client.Send(message);
                    }
                    MessageBox.Show("Sent all messages", "Hooray!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
                else //this is for the unknown bit.
                {
                    for (int i = 0; i < j; i++)
                    {
                        client.Send(message2);
                        client.Send(message3);
                        client.Send(message4);
                        client.Send(message5);
                    }
                    MessageBox.Show("Sent all messages", "Hooray!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Exception caught in CreateTestMessage2(): {0}",
                  ex.ToString());
            }             
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Carrier.Items.Add(new EmailInfo("@txt.att.net","AT&T"));
            Carrier.Items.Add(new EmailInfo("@vtext.com","Verizon"));
            Carrier.Items.Add(new EmailInfo("@tmomail.net", "T-Mobile"));
            Carrier.Items.Add(new EmailInfo("@messaging.sprintpcs.com", "Sprint"));
            Carrier.Items.Add(new EmailInfo("@randomnezzle.com", "Unknown (A LOT Slower)"));           
            Carrier.SelectedIndex = 0;
            NumberOfTexts.SelectedIndex = 0;
        }

        private void Carrier_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:44:37+00:00Added an answer on May 26, 2026 at 3:44 am

    Outlook is the typical place where folks store their contacts.

    Here’s a code snippet to enumerate all the outlook contacts via C#:

    Enumerating Outlook ContactItem properties

    and another:

    http://dotnet-snippets.com/dns/get-all-outlook-contacts-SID611.aspx

    Also, here’s an overview of the outlook object model:

    http://msdn.microsoft.com/en-us/library/ms268893(v=vs.80).aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I recently wrote an iPad app that I would like to make a universal
I recently wrote mailing list software in Ruby On Rails. I would like to
I recently wrote a program that used a simple producer/consumer pattern. It initially had
I recently wrote a java program transforming a SVG document to HTML/ Canvas :
I recently wrote a short algorithm to calculate happy numbers in python. The program
I recently wrote a piece of code that looked a bit like this: IEnumerable<DTO.Employee>
I recently wrote a rather ugly looking one-liner, and was wondering if it is
I recently wrote a program that takes inputted char data, tests if it is
I recently wrote a c# program on framework 4, before realising the entire company
I recently wrote a parser in Python using Ply (it's a python reimplementation of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.