New topic: Problems sending email from Dreamhost server
<http://forums.realsoftware.com/viewtopic.php?t=45859> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message dgdavidge Post subject: Problems sending email from Dreamhost serverPosted: Fri Nov 09, 2012 12:29 pm Joined: Fri Jun 02, 2006 1:43 pm Posts: 163 Location: Santa Ynez, CA This week I had a customer irate because my web app would not send her an email allowing her access to the system. It turns out she has Comcast email and that AOL and Comcast spam filters block emails forwarded through Dreamhost. It appears they also block email sent by RS web apps on Dreamhost. I verified this by having the app send a message to a friend who also uses Comcast. He didn't get it either. I also maintain a couple sites hosted on iPower and the friend reports he get weekly messages from a PHP program I wrote hosted there for our Rotary club. The solution appears to be to have my Dreamhost app send its emails through iPower rather than Dreamhost. But iPower uses POP before SMTP authentication and I have run into timing issues trying to do this with RS. Until now, I have not subclassed SMTPSockets. I have used them successfully in both desktop and web apps to connect and send a message without verifying that the connection was made or the message sent. If the parameters are right, they work every time. My first attempt was simply to put a POP3Socket before my SMTPSocket, connect and request any messages. Then without waiting for an answer, the SMTPSocket runs. Surprisingly, this runs in the debugger (I assume I am already authenticated) but not from the app on Dreamhost. Next step was to add a timer, subclass the two sockets and call their methods from the timer.action. It didn't work. The two sockets were still webpage properties and the language reference says updating a webpage from a timer has timing issues of its own. So I made the subclassed sockets properties of the timer. Now I am at a roadblock and unable to properly refer to timer properties from the pop3socket.LoginSuccessful event. My timer.Action is Sub Action() static i As Integer Select case stage Case 0 // connect to pop server to authenticate smtp popConnect stage = 1 Case 1 // verify pop connection i = i + 1 if i > 50 then // wait 5 seconds for connection before timeout i = 0 if errMsg = "" then errMsg = "POP connection timeout" // pop server may have set the errMsg value stage = 5 end if Case 2 // send Email to user SendPassword Case 3 // wait for the mail to be sent i = i + 1 if i > 100 then i = 0 if errMsg = "" then errMsg = "SMTP connection timeout" // pop server may have set the errMsg value stage = 5 end if case 4 // update screen WebPage1.stHelp.Text = "Email was sent. Check your email then return here and Log In." me.Enabled = False case 5 // if not sent, update screen WebPage1.stHelp.Text = "There was a problem sending the email, please call customer support at 1-805-688-9696" + EndOfLine + errMsg me.Enabled = False end Select End Sub pop is the subclassed Pop3Socket and a property of the timer. stage as Integer is also a timer property. popConnect is a timer method that connects to the popServer. The pop.LoginSuccessful code is Sub LoginSuccessful() me.ListMessages // authenticate the connection so smtp will work WebPage1.timer1.stage = 2 End Sub When I run the program, the debugger stops with a bug icon next to the ...stage=2 line. I have tried every other reference I can think of and always get a "This method or property does not exist" error during compilation. Any suggestions would be most appreciated. I am running 2011r4.3 on Windows 7 Pro. If this isn't going to work in RS, my workaround will be a PHP script on the iPower server that the web app can call. I probably could have converted the Rotary email script in the time it took to write this. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- 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]
