Jump to content

email sending to external address?


Remitur

Recommended Posts

i would need to send emails to external address, which are not customers.

That's to say: in a Registrar module, sometimes I need to send a message to the Registrant of the domain (who is different from the customer).

Does exist any WHMCS API or trick to do it, instead of hard-coding it (with all difficulties about languages, templates, SMTP authentication etc.) ?

The API command sendmail ( https://developers.whmcs.com/api-reference/sendemail/ ) send email only to registered clients ... and so, does exist any way to send an email to any external address?  

(A trick may be: I create a new fake client, send the email to him, and then delete the client... but it's not "elegant"...) 

Link to comment
Share on other sites

Yeah, as you mentioned the API can be used to send mail to the registered clients.

But still you can write custom code to send a mail to any other email id.

After what action you would like to send the mail?

Just after a domain is registered or transferred?

Link to comment
Share on other sites

On 10/11/2017 at 2:29 PM, wtools said:

But still you can write custom code to send a mail to any other email id.

Yes, but it's more code which you need to take care of (if you change SMTP, i.e.)

And you loose the function of WHMCS to log email sending, and the standard email formatting by WHMCS, and to possibility to use templates...

On 10/11/2017 at 2:29 PM, wtools said:

After what action you would like to send the mail?

Just after a domain is registered or transferred?

There're a number of different cases: when a domain is registered or transferred, but also the sending of authinfo to th registrant, expiring notifications, abuse notifications...

A way could be this:

  • You select a fake client-id (i.e. 1000)
  • when you need to send an email to registrant@anydomain.com you modify the data of   client with id 1000 (changing the name and the email address)
  • then you send the email
  • and immediately after the sending you modify again the data of client id-1000 with fake data...

It's not elegant, but it should work...

 

 

Link to comment
Share on other sites

9 minutes ago, Remitur said:

and the possibility to use templates...

if the external email address is common to a specific template, e.g let's say you want to send a copy to external@someothercompany.com of an email sent to a client using a template, you could use the bcc functions within v7.4 email templates (at least once it gets a full release).... though if it's only on an ad-hoc basis, and not constantly needed, then that's not an option.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated