Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 11-27-2008, 10:50 AM   #1 (permalink)
 
Newb Techie

Join Date: Sep 2008

Posts: 34

pcbres12 is on a distinguished road

Default Text messaging

Hello all,

I want to make a program, where you can enter your cell number and provider and hit a submit button. In turn when you submit your info you will recive text messages on your phone. What language will I need to write this in? Is there a place where something like this can be downloaded? Could someone give me an example of what needs to be done???
pcbres12 is offline  
Old 11-27-2008, 11:12 AM   #2 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,466

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Text messaging

I actually wrote something similar last month. It's a basic email and text messaging system written in C#. Let me know if you want it.
__________________

Baez is offline  
Old 11-27-2008, 11:16 AM   #3 (permalink)
 
Newb Techie

Join Date: Sep 2008

Posts: 34

pcbres12 is on a distinguished road

Default Re: Text messaging

yes, if you could give that to me I would be very greatful.
pcbres12 is offline  
Old 11-28-2008, 08:54 PM   #4 (permalink)
Saxon's Avatar
 

Join Date: Feb 2007

Posts: 6,362

Saxon is just really niceSaxon is just really niceSaxon is just really niceSaxon is just really nice

Default Re: Text messaging

Chris can I get a copy of that?
__________________
I am not here for long I am deploying soon so please don't expect anything long winded.

Saxon is offline  
Old 11-28-2008, 11:26 PM   #5 (permalink)
 
Newb Techie

Join Date: Sep 2008

Posts: 34

pcbres12 is on a distinguished road

Default Re: Text messaging

Could you send that to me please???
pcbres12 is offline  
Old 11-30-2008, 01:49 PM   #6 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,466

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Text messaging

I've tried to upload the files a couple times to my site but it's failed. I called the hosting company and they said it should be fixed by tonight so hopefully that means in 6 hours or so.
__________________

Baez is offline  
Old 11-30-2008, 03:18 PM   #7 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default Re: Text messaging

Go with megaupload if you still have problems, I would be interested, also

Cheers,

~ Tkey
Yek is offline  
Old 12-02-2008, 08:35 PM   #8 (permalink)
Dr.House's Avatar
 
True Techie

Join Date: Dec 2008

Location: Rx Counter

Posts: 147

Dr.House is on a distinguished road

Send a message via AIM to Dr.House
Default Re: Text messaging

Its an easy application to write, just make a PHP/Ruby/Python script which sends an email to the phone number, youll need the providers Email to SMS portal address (Verizon is number@vtext.com. If you wanted to send SMS to more providers, youd need to figure out if they have some kind of email-to-SMS portal system as well.
I don't like that your just handing code over (nevertheless C# code), as a programmer you should encourage learning by having those guys figure it out and giving them little hints if they cant find it on their own. Ah well, perhaps I am just old fashioned!
Dr.House is offline  
Old 12-03-2008, 05:22 AM   #9 (permalink)
Baez's Avatar
 

Join Date: Sep 2005

Location: Toronto, Canada

Posts: 5,466

Baez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of lightBaez is a glorious beacon of light

Default Re: Text messaging

Alright I give up on my hosting. Found a server with my college that supports .aspx pages.

Here is where a working version of the page is: Chris Bornhoft - Email System. Of course no email will work because as you see in the code below the SMTP server I used is called mailserver.com which doesn't exist. But I have used it with my own site's email and yahoo's email and they both work.

Here is the ASP.NET code:

Code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="email.aspx.cs" Inherits="extra_email" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Chris Bornhoft - Email System</title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
        .style2
        {
            font-family: Arial;
        }
        .style3
        {
            font-family: Arial;
            width: 177px;
        }
    </style>
</head>
<body>

    <form id="form1" runat="server">

    <h3 class="style2">Email System</h3>

    <table class="style1">
        <tr>
            <td class="style3" valign="top">
                <span class="style2">Select a Message Type:</span> </td>
            <td class="style2">
        <asp:DropDownList ID="ddl_type" runat="server" AutoPostBack="True" 
                    onselectedindexchanged="ddl_type_SelectedIndexChanged">
            <asp:ListItem Value="Email">Email</asp:ListItem>
            <asp:ListItem Value="Text">Text</asp:ListItem>
        </asp:DropDownList>
                <br />
                <br />
            </td>
        </tr>
        <tr>
            <td class="style3" valign="top">
                <asp:Label ID="lbl_to" runat="server" Text="To:"></asp:Label>
            </td>
            <td class="style2">
                <asp:TextBox ID="tbx_to" runat="server" Width="200px"></asp:TextBox>
                <br />
            </td>
        </tr>
        <tr>
            <td class="style3" valign="top">
                <asp:Label ID="lbl_user" runat="server" Text="User:"></asp:Label>
            </td>
            <td class="style2">
                <asp:TextBox ID="tbx_user" runat="server" Width="200px"></asp:TextBox>
                <br />
            </td>
        </tr>
        <tr>
            <td class="style3" valign="top">
                <asp:Label ID="lbl_pass" runat="server" Text="Password:"></asp:Label>
            </td>
            <td class="style2">
                <asp:TextBox ID="tbx_pass" runat="server" Width="200px"></asp:TextBox>
                <br />
            </td>
        </tr>
        <tr>
            <td class="style3" valign="top">
                <asp:Label ID="lbl_cc" runat="server" Text="CC:"></asp:Label>
            </td>
            <td class="style2">
                <asp:TextBox ID="tbx_cc" runat="server" Width="200px"></asp:TextBox>
                <br />
                <br />
                <br />
            </td>
        </tr>
        <tr>
            <td class="style3" valign="top">
                Subject:</td>
            <td class="style2">
                <asp:TextBox ID="tbx_subject" runat="server" Width="200px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style3" valign="top">
                Message:</td>
            <td class="style2">
                <asp:TextBox ID="tbx_message" runat="server" Height="300px" Width="600px" 
                    TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
    </table>

    <asp:Button ID="btn_send" runat="server" Text="Send" Width="80px" onclick="btn_send_Click"/>

    <br />
    <p>
        <asp:Label ID="lbl_error" runat="server" style="font-family: Arial"></asp:Label>
    </p>

</form>

</body>
</html>
Here is the server side C# code:

Code:
using System;
using System.Data;
using System.Configuration;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Net;
using System.Net.Mail;
using System.Collections;


public partial class extra_email : System.Web.UI.Page
{
    protected void ddl_type_SelectedIndexChanged(object sender, EventArgs e)
    {
        if(ddl_type.SelectedValue == "Email")
        {
            lbl_to.Text = "To:";
            lbl_user.Text = "User:";
            lbl_pass.Visible = true;
            tbx_pass.Visible = true;
            lbl_cc.Visible = true;
            tbx_cc.Visible = true;
        }
        else if (ddl_type.SelectedValue == "Text")
        {
            lbl_to.Text = "Phone Number:";
            lbl_user.Text = "Your Phone Number:";
            lbl_pass.Visible = false;
            tbx_pass.Visible = false;
            lbl_cc.Visible = false;
            tbx_cc.Visible = false;
        }
    }
    
    protected void btn_send_Click(object sender, EventArgs e)
    {
        string to = tbx_to.Text;
        string from = tbx_user.Text + "@mailserver.com";
        string user = tbx_user.Text;
        string pass = tbx_pass.Text;
        string cc = tbx_cc.Text;
        string subject = tbx_subject.Text;
        string message = tbx_message.Text;

        MailAddress From = new MailAddress(from);
        MailAddress To = new MailAddress(to);
        MailMessage Mail = new MailMessage(From, To);

        //NetworkCredential UserInfo = new NetworkCredential(user, pass);

        Mail.Subject = subject;
        Mail.Body = message;

        SmtpClient MailServer = new SmtpClient("mailserver.com", 465);

        /*
        MailServer.EnableSsl = true;
        MailServer.UseDefaultCredentials = false;
        MailServer.Credentials = UserInfo;
        */

        if(ddl_type.SelectedValue == "Email")
        {
            if (cc.Length > 0)
            {
                MailAddress c = new MailAddress(cc);
                Mail.CC.Add(c);
            }
        }
        else
        {
            SmtpClient TextServer = new SmtpClient("textserver.com");

            try
            {
                TextServer.Send(Mail);
                lbl_error.Text = "Message successfully sent.";
            }
            catch (Exception ex)
            {
                lbl_error.Text = ex.ToString();
            }
        }

        try
        {
            MailServer.Send(Mail);
            lbl_error.Text = "Mail successfully sent.";
        }
        catch (Exception ex)
        {
            lbl_error.Text = ex.ToString();
        }
    }
}
I did not implement any textbox validation so if you leave an email box blank the page will crash. If you need validation I can easily assist you with it.

Hope it helps. If you have any questions on what something means feel free to ask.
__________________


Last edited by Baez; 12-03-2008 at 05:34 AM.
Baez is offline  
Old 12-03-2008, 05:33 PM   #10 (permalink)
 
Newb Techie

Join Date: Sep 2008

Posts: 34

pcbres12 is on a distinguished road

Default Re: Text messaging

Now, with this code, is there a way to make it so that a person can text to a number and the computer will throw out a random message at them? Also can I just copy and paste this in a notepad doc, as it is on here?
pcbres12 is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nokia text messenger Vista gadget Osiris Phones – PDA’s – Bluetooth – Other handhelds 4 04-01-2008 06:51 AM
Text encryption tools White_Wolf Off Topic Discussion 4 01-13-2008 09:34 AM
Send Text Messages From your PC. KCRMYZ NEW Technology Services & Products 0 08-16-2007 05:40 PM
Not the final option objecterror Web Graphics, Design, Digital Images 2 07-22-2007 03:14 PM
using one text box for different variables (php) zach014 Programming Discussions 2 07-11-2007 10:30 PM