New topic: 

help send email

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

         Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic          Author  
Message        jetpr          Post subject: help send emailPosted: Tue Apr 02, 
2013 7:51 pm                                 
Joined: Wed Sep 20, 2006 5:12 pm
Posts: 629
Location: Puerto Rico                Hello is a way to send email from any 
email account gmail,hotmail...  with out to change the code      
_________________
Thanks for any contribution  and  God blesses all (I start Using RS in 
10/12/2010)
 Mac Mini with Lion v10.7.5 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 
Personal  and  Linux RS2012r1 Personal Register user 
   my Hobbies R/C Turbines Jets Models  
                             Top                timhare          Post subject: 
Re: help send emailPosted: Tue Apr 02, 2013 8:00 pm                         
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12200
Location: Portland, OR  USA                Have the user enter his email 
settings, just like in Outlook or Mail.  Save them, of course, so he doesn't 
have to enter them every time, but there's no other way.  The settings include 
host, port and whether it's secure, in addition to user name and password.   
                             Top                jetpr          Post subject: 
Re: help send emailPosted: Tue Apr 02, 2013 8:31 pm                             
    
Joined: Wed Sep 20, 2006 5:12 pm
Posts: 629
Location: Puerto Rico                so i have to use this code for all type of 
email
  
eMailControl.Address ="smtp.gmail.com"
  eMailControl.Port = 587
  eMailControl.Username =""
  eMailControl.Password = ""
  
  // Connect To Server
  eMailControl.Secure = True
  eMailControl.ConnectionType = SSLSocket.TLSv1
  eMailControl.Connect()      
_________________
Thanks for any contribution  and  God blesses all (I start Using RS in 
10/12/2010)
 Mac Mini with Lion v10.7.5 and Real Studio 2012r1 Pro And Windows 7 RS2012r1 
Personal  and  Linux RS2012r1 Personal Register user 
   my Hobbies R/C Turbines Jets Models  
                             Top                msssltd          Post subject: 
Re: help send emailPosted: Wed Apr 03, 2013 1:28 am                             
    
Joined: Fri Oct 28, 2005 7:05 am
Posts: 534
Location: Emsworth, UK                jetpr wrote:so i have to use this code 
for all type of email
  
eMailControl.Address ="smtp.gmail.com"
  eMailControl.Username =""
  eMailControl.Password = ""


Yes.  Sending mail by SMTP is session based.

Quote: 
  // Connect To Server
  eMailControl.Port = 587
  eMailControl.Secure = True
  eMailControl.ConnectionType = SSLSocket.TLSv1


Perhaps.  Port numbers and authentication settings may vary, depending on how 
the SMTP server has been configured.  You must set the SMTPSocket parameters to 
be compatible with the mail server you are trying to send mail to.

Off the top of my head, G-Mail port 587 is SMTP AUTH, which means the initial 
connection is plain text hence the .Secure property should initially be set 
.false.  It's a while since I read the g-mail docs, so I could be wrong.  
Always read the service documentation first, is always my advice.

Quote:  eMailControl.Connect()


No. Never.  You should use the Events and Methods defined by the SMTPSocket and 
not those defined by the TCPSocket class it is sub classed from.

Callng the method eMail.SendMail, will cause a connection to the server and 
transfer of mail to appear to be a single operation without interruption.  The 
eMail.MailSent event will be raised when the operation is complete.

The SMTPSocket class is an automation object, which uses a TCPSocket to send an 
e-mail batch to a single mail server (many messages -> one server).  
Manipulating (some) events and methods of the underlying TCPSocket directly, 
interferes with the correct functioning of the SMTPSocket.  Ideally there would 
be a way to hide attributes which are unsafe to access in derived classes but 
in RS, there isn't.      
_________________
Yes it's me in the avatar  
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 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