Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

Sending email via a different SMTP server.

 [1/4] from: philb:upnaway at: 29-Jul-2002 21:32


Hi everyone, I want to send email via a different SMTP server than the default one set in user.r. But I want to leave everything unchanged after the email, so anything I replace must be put back. Is there an offical way of doing this? Cheers Phil

 [2/4] from: gerardcote:sympatico:ca at: 29-Jul-2002 10:19


Hi Phil, Subject: [REBOL] Sending email via a different SMTP server.
> I want to send email via a different SMTP server than the default one set in > user.r. > > But I want to leave everything unchanged after the email, so anything I replace > must be put back. > > Is there an offical way of doing this? >
I looked at some documentation a while ago in http://rebol.com/docs/core23/rebolcore-13.html#sect3.4. and found that "set-net" can be used for this kind of email setting. Look there for a coding example. I also saw some coding examples using set-net in a REB library but I can't remember which one it was ... Hope this will help you to start with. Gerard

 [3/4] from: gscottjones::mchsi::com at: 29-Jul-2002 13:17


Phil wrote:
> I want to send email via a different SMTP server than the default one set
in
> user.r. > > But I want to leave everything unchanged after the email, so anything I
replace
> must be put back. > > Is there an offical way of doing this?
Hi, Phil, Several ways to do this. The simpliest maybe to capture the original smtp server name, reset it to a temporary new one, send the email, then reset the server name back. Something like: old-host: system/schemes/default/host system/schemes/default/host: "new.smtp.mynetwork.dom" send [myname--mydomain--dom] "Hello" system/schemes/default/host: old-host The alternative approach is to hack a new copy of send function that will allow a refinement that allows an alternative smtp host name to be passed to the function. If you prefer this later approach and my description is less than clear, I would be happy to present a prototype. (I am short of time right now.) Hope this helps. --Scott Jones

 [4/4] from: zokie:libero:it at: 30-Jul-2002 12:40


Hello [philb--upnaway--com] On 29-Lug-02, [philb--upnaway--com] wrote:
> But I want to leave everything unchanged after the email, so anything I > replace must be put back.
I do this: ; makes a clone and changes it to new setup meragip-net-setup: copy default-net-setup: get-net change meragip-net-setup meragip-email ;swaps setup set-net meragip-net-setup ;Makes IO with SMTP server submit-emails %mailbox/outgoing/ organization meragip-email ; restores user default set-up set-net default-net-setup
> Is there an offical way of doing this?
set-net is official, get-net is mine ;) get-net: does [{Gets data from current Rebol Network Setup} reduce [system/user/email system/schemes/default/host system/schemes/pop/host system/schemes/default/proxy/host system/schemes/default/proxy/port-id system/schemes/default/proxy/type]] Regards -- "Where did you get all those facts!?!"