Activity Stream
93,440 MEMBERS
25 ONLINE
Send Email Message Send Email Message Send Email Message Send Email Message Send Email Message
Results 1 to 1 of 1
  1.    Tweet this post   Share This Post On Facebook Share This Post On Google+
    #1
    Programmar
    Xcode's Avatar

    Idea Send Email Message

    Source Code : 
    from smtplib import SMTP
    DEF_FROM 
    [email protected]'
    DEF_SMTP_SERVER 'localhost'
     
    class SENDMAILError:
     
        
    def __init__selferror ):
            
    self.error error
     
        def __repr__
    self ):
            return 
    self.error
     
    def sendmail
    toaddrsmsgsubject=Nonefromaddr=DEF_FROMsmtpServer=DEF_SMTP_SERVER ):
        
    """Send an email to the given addresses"""
     
        
    if smtpServer is None:
            
    smtpServer 'localhost'
     
        
    if typetoaddrs is StringType:
            
    toaddrs toaddrs.split()
        
    elif not typetoaddrs is ListType:
            
    raise SENDMAILError"toaddrs must be a string or a list" )
     
        try:
            
    headers = ("From: %s\nTo: %s\n\n"

    [Login or Register to remove this advertisement]

               
    % ( fromaddr", ".jointoaddrs ) ) )
            if 
    not subject is None:
                
    headers "Subject: %s\n" subject headers
     
            server 
    SMTPsmtpServer )
            
    server.sendmailfromaddrtoaddrsheaders msg )
            
    server.quit()
        
    except Exceptione:
            
    raise SENDMAILErrorstr) ) 
    thanks to kangell
    Xcode Reviewed by Xcode on . Send Email Message from smtplib import SMTP DEF_FROM = [email protected]' DEF_SMTP_SERVER = 'localhost' class SENDMAILError: def __init__( self, error ): self.error = error def __repr__( self ): Rating: 5

  2. The Following 1 Users Say Thank You to Xcode For This Useful Post:
    [ Click to Expand ]

    Rebel (4th March 2012)

  3.   Advertisements

Thread Information

Users Browsing this Thread

There Are Currently 1 Users Browsing This Thread. (0 Members and 1 Guests)

Similar Threads

  1. Send Anywhere PRO v4.3.6
    By mrirfan555 in forum Android OS Applications
    Replies: 0
    Last Post: 11th March 2014, 09:21 AM
  2. Send Anywhere PRO v4.2.11
    By BrainDrain in forum Android OS Applications
    Replies: 0
    Last Post: 12th February 2014, 01:02 PM
  3. Send It Pro v1.6.1
    By mega_bot in forum Android OS Applications
    Replies: 0
    Last Post: 11th February 2013, 07:19 AM
  4. [SIS] Antarix Imsy Messenger v1.2 (0) S60v3v5 Anna Belle SymbianOS 9.x Signed-Send a free message [02/02/
    By Google in forum Symbian S60 v5th ^1 (i8910HD,5800,N97,Mini,X6) Apps
    Replies: 0
    Last Post: 2nd February 2012, 12:36 AM
  5. Replies: 0
    Last Post: 2nd February 2012, 12:19 AM

Tags for this Thread

BE SOCIAL
Send Email Message Send Email Message Send Email Message Send Email Message Send Email Message