New topic: 

Sending an email to someone in an address book.

<http://forums.realsoftware.com/viewtopic.php?t=44773>

         Page 1 of 1
   [ 6 posts ]                 Previous topic | Next topic          Author  
Message        Farflame          Post subject: Sending an email to someone in 
an address book.Posted: Thu Jul 19, 2012 10:54 am                         
Joined: Tue Oct 05, 2010 6:25 am
Posts: 149                I have a program which I use for my business, which 
was written for me several years ago by another programmer, in VB. I'd like to 
rewrite this myself with RB since it has some limitations that I'd like to get 
rid of, but I'm not sure if it's possible in RB, or if I'm capable of doing it. 
I have written a fairly large program in RB but I don't like getting involved 
in technical stuff like sending emails - always seems to confuse me.

So here's what the program does. I have a fairly large chunk of files, all 
stored in the same folder, which need to be attached to an email and sent to 
people in my address book, then deleted. There are two files for each customer 
- a small text file (about 5k max) and a larger html file (around 200k), both 
with the same name but a different extenstion - e.g elz1.txt and elz1.htm. The 
name of the customer is stored in the first line of the text file, so it needs 
to read the first line, then match the name up with the name in my address 
book, then create the email, attach both files, send the email, then delete the 
files.

The limitations I have with the current program are that it requires me to use 
Microsoft Outlook 2003 plus an add-on. I don't particularly like Outlook and 
the add-on also causes problems. Also, I need to reformat the PC urgently due 
to Windows issues and this requires a lot of backing up, finding licenses etc 
(I realise this is something that's necessary when reinstalling anyway but 
would still prefer a program which doesn't require either Outlook or the addon).

So my questions are - is RB capable of this and would it be very complicated? I 
know I can do lots of the stuff mentioned, such a parsing the text files and 
deleting the files, aswell as making the interface. What I don't know how to do 
is, check address books or create and send emails (with attachments). Does 
anyone know of a place I can read about these things for RB? Would the address 
book issue mean I have to use a certain email program?

What I'm thinking now is that it would be much easier if I created an extra 
text file which stores the names and email addresses of my customers, instead 
of having them read from a specific address book. That would be easier for me 
to update than an address book and presumably easier for the program to extract 
the email address. So then it would just be a case of sending the emails?   
                             Top                Bob Coleman          Post 
subject: Re: Sending an email to someone in an address book.Posted: Thu Jul 19, 
2012 11:12 am                         
Joined: Fri Nov 16, 2007 10:18 pm
Posts: 140
Location: Portland, OR                To start this link will show how easy 
email attachments are:  http://docs.realsoftware.com/index.php/EmailAttachment

No need for third party programs or plugins to handle this.

Now as to address book management.  Look into REALSQLdatabases: 
http://docs.realsoftware.com/index.php/REALSQLdatabase

Just setup a simple database with a data entry form to manage your address 
book. 

As to scheduling the emails, is this something where the presence of the files 
should trigger an email or should it be triggered by clicking a button?  If the 
former use a timer to have your program scan the directory for the required 
files and if they exist build and send the message.  If the latter then it 
really doesn't matter.   
                             Top                Farflame          Post subject: 
Re: Sending an email to someone in an address book.Posted: Thu Jul 19, 2012 
11:35 am                         
Joined: Tue Oct 05, 2010 6:25 am
Posts: 149                Thanks for the reply, will look into the link.

No need for scheduling at all, I need to click a button to send so that part's 
nice and easy    
                             Top                Farflame          Post subject: 
Re: Sending an email to someone in an address book.Posted: Thu Jul 19, 2012 
2:03 pm                         
Joined: Tue Oct 05, 2010 6:25 am
Posts: 149                This doesn't look too bad, the examples are very 
comprehensive and pretty much do everything I need other than a bit of tweaking 
(I hope).

One very basic question though, where's the SMTPSocket? Do I just create a 
basic 'Object' and set it's super to SMTPSocket? Is there a faster way to do 
that?   
                             Top                shaosean          Post subject: 
Re: Sending an email to someone in an address book.Posted: Thu Jul 19, 2012 
3:08 pm                         
Joined: Mon Aug 15, 2011 10:25 pm
Posts: 140                - add a TCPSocket to the window
- set the super to SMTPSocket   
                             Top                Farflame          Post subject: 
Re: Sending an email to someone in an address book.Posted: Thu Jul 19, 2012 
11:56 pm                         
Joined: Tue Oct 05, 2010 6:25 am
Posts: 149                Thanks, I ended up just copying and pasting most of 
the example code (including the interface and therefore the SMTPSocket) since 
it mostly suits my needs. Was just a case of making a few alterations to my 
needs and now I just have to work on adapting it fully to what I want. But this 
turned out to be much easier than I was expecting - sending emails really isn't 
compicated anyway, I'm not sure why I thought it was... or maybe RB just makes 
it look easy 

Thanks for letting me know how to create the control manually, worth knowing 
anyway    
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 6 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to