Announcement

Collapse
No announcement yet.

vb5 api - how to use different email host/port/password settings

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • vb5 api - how to use different email host/port/password settings

    I am using vb562pl1.

    Besides the standard forum use I am connecting my app to vb via API. I can send emails using standard email settings set in the Email Options section. This is fine for most of the time. Although having a big board makes the emaildeliverability an issue.

    What I am trying to accomplish - for some more sensitive email tasks I'd like to use other than the standard email credentials and settings in my script. So how would I set other host/port/password/etc. just for this particular connection?

    in vb3 I'd have to just assign the credentials to the corresponding variables:
    $vbulletin->options['smtp_host'] =
    $vbulletin->options['smtp_port'] =
    $vbulletin->options['smtp_user'] =
    $vbulletin->options['smtp_pass'] =
    $vbulletin->options['smtp_tls'] =

    and it worked.

    Kindly asking for directions
    What's brewing in Poland? Find out on www.Browar.biz (in Polish)
    PL: Modyfikacje vB: www.pub.net.pl

  • #2
    You probably want to look at the vB_Mail class in /core/vb/mail.php.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment


    • #3
      If someone looks for an answer on this, the below code worked for me,
      it temporarily changes the email sending service to other than the one set in vbulletin email settings):

      PHP Code:

      vB
      ::getDatastore()->setOption('webmasteremail'$alternativemail['email'], false);
      vB::getDatastore()->setOption('smtp_host'$alternativemail['smtp_host'], false);
      vB::getDatastore()->setOption('smtp_port'$alternativemail['smtp_port'], false);
      vB::getDatastore()->setOption('smtp_user'$alternativemail['smtp_user'], false);
      vB::getDatastore()->setOption('smtp_pass'$alternativemail['smtp_pwd'], false);
      vB::getDatastore()->setOption('smtp_tls'$alternativemail['smtp_tls'], false); 
      smtp_tls option is "none", "tls" or "ssl", Should be lower case.
      Upper case won't work (checked with gmail, tls is ok TLS is not).
      What's brewing in Poland? Find out on www.Browar.biz (in Polish)
      PL: Modyfikacje vB: www.pub.net.pl

      Comment

      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
      Working...
      X