×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Registered User
    Join Date
    Mar 2009
    Posts
    5

    default access point for sending email

    hi everyone!

    I want to send email but using some default or choosen(once) access point.
    I'm using smtplib.SMTP and it always ask for access point.

    i try to use following:

    apid = None
    try:
    sys.modules['socket'] = __import__('btsocket')
    except ImportError:
    pass
    apid = socket.select_access_point()

    apo = socket.access_point(apid)
    socket.set_default_access_point(apo)
    apo.start()


    but this one ask for access point and after that smtplib.SMTP ask again.

    help

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: default access point for sending email

    Quote Originally Posted by kosmonauta View Post
    hi everyone!

    I want to send email but using some default or choosen(once) access point.
    I'm using smtplib.SMTP and it always ask for access point.

    i try to use following:

    apid = None
    try:
    sys.modules['socket'] = __import__('btsocket')
    except ImportError:
    pass
    apid = socket.select_access_point()

    apo = socket.access_point(apid)
    socket.set_default_access_point(apo)
    apo.start()


    but this one ask for access point and after that smtplib.SMTP ask again.

    help
    hello kosmonauta

    welcome to forum nokia python dibo

    you need to go through this article which will help you to set the access point for your email application.

    Feel free to ask if you face any sort of problem in getting that.

    Regards

  3. #3
    Registered User
    Join Date
    Mar 2009
    Posts
    5

    Cool Re: default access point for sending email

    gaba88 thanks for answer,

    i have no idea how to use that script in my code. my is following simple:

    def send_email():
    hour = time.localtime()[3]
    min = time.localtime()[4]
    SUBJECT = "SMS came at " + str(hour) + ":" + str(min)
    TO = "to@someone.com"
    FROM = "from@me.com"
    TEXT = "blabla"
    SERVER = "smtp.me.pl"
    message = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n%s" % (FROM, TO, SUBJECT, TEXT)
    server = smtplib.SMTP(SERVER, )
    server.ehlo()
    server.login("login", "pass")
    server.sendmail(FROM, TO, message)
    server.quit()
    print "Email send"


    here server = smtplib.SMTP(SERVER, ) (i think) it ask for access point every time i want to send email, but how can I do it to make it once or define access point in code?

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: default access point for sending email

    hello kosmonauta

    what you can do is get the function from the article i showed you which sets the default access point then you can ask the user to set a access point at the first of the script and make that as a default access point.

    Hope you got my point.

    Regards
    Gaba88

  5. #5
    Registered User
    Join Date
    Aug 2009
    Posts
    9

    Re: default access point for sending email

    py 1.9.7. doesn't work: "
    'module' object has no attribute 'select_access_point'
    "

  6. #6
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: default access point for sending email

    Quote Originally Posted by yair.almog View Post
    py 1.9.7. doesn't work: "
    'module' object has no attribute 'select_access_point'
    "
    hello

    i think you are using socket in place of btsocket please refer the PyS60 api docs for more details.

    Regards
    Gaba88

  7. #7
    Regular Contributor
    Join Date
    Oct 2007
    Posts
    114

    Re: default access point for sending email

    Quote Originally Posted by yair.almog View Post
    py 1.9.7. doesn't work: "
    'module' object has no attribute 'select_access_point'
    "
    The socket module does not have "select_access_point" but only set_default_access_point and access_points API. You can emulate the functionality for select_access_point as shown in the example here - http://pys60.garage.maemo.org/doc/li...le-socket.html (Example under set_default_access_point at the bottom of the page)
    import antigravity

  8. #8
    Registered User
    Join Date
    Aug 2009
    Posts
    9

    Re: default access point for sending email

    Right you are. Thanks

Similar Threads

  1. Replies: 3
    Last Post: 2009-10-10, 19:34
  2. Default Access Point
    By gsetiawan in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2008-05-22, 17:28
  3. MMS, EMail - Access Point in Use
    By ajaysbhatia in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2007-10-11, 05:44
  4. default access point
    By vp in forum Python
    Replies: 13
    Last Post: 2007-04-08, 07:33
  5. How to set default access point for wap browser
    By birol.sekerci in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2006-05-17, 08:43

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •