@mail using SMTP from settings?

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
miteshpc
Posts: 6
Joined: 2016-04-04 20:19

@mail using SMTP from settings?

Post by miteshpc » 2017-11-26 20:08

I have hooks created before the SMTP settings were introduced in admin area.

My hooks still send out email, but using the old SMTP settings, where to change those settings now?

R Tammam
Veteran Member
Posts: 113
Joined: 2017-08-26 15:35

Re: @mail using SMTP from settings?

Post by R Tammam » 2017-12-10 04:31

There is another function sendmail you can use and its paramters
assoc array $mail( ['to', 'name', 'subject', 'message'] )

facos79
Veteran Member
Posts: 115
Joined: 2014-10-29 12:31

Re: @mail using SMTP from settings?

Post by facos79 » 2018-06-11 10:08

Hello,
how can I use the smtp parameters to send table records via email? I need to use SMTP SSL

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: @mail using SMTP from settings?

Post by a.gneady » 2018-06-13 13:24

If you have configured SMTP SSL in the Admin settings page under the admin area, all you need to do is use sendmail() function instead of mail. Here is an example of how to use it (it takes its mail config from the admin settings page):

Code: Select all

sendmail(array(
   'to' => 'recipient email',
   'name' => 'recipient name (optional)',
   'subject' => 'Mail subject',
   'message' => 'Mail message, HTML allowed'
));
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: @mail using SMTP from settings?

Post by jsetzer » 2018-08-15 16:45

Could you please support CC, BCC and ReplyTo fields in the future.

Your sendmail function should look something like this:

Code: Select all

function sendmail( ... ) {

        // ...
        
	$pm->addAddress($mail['to'], $mail['name']);

// NEW CODE BELOW ------------------------------	
        if ($mail['replyto'])
	    $pm->addReplyTo($mail['replyto']);
        if ($mail['cc'])
            $pm->addCC($mail['cc']);
        if ($mail['bcc']) 
            $pm->addBCC($mail['bcc']);
        
        // ....
}
Kind regards,
<js />

My AppGini Blog:
https://appgini.bizzworxx.de/blog

You can help us helping you:
Please always put code fragments inside [code]...[/code] blocks for better readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

User avatar
a.gneady
Site Admin
Posts: 1281
Joined: 2012-09-27 14:46
Contact:

Re: @mail using SMTP from settings?

Post by a.gneady » 2018-08-23 14:23

Thanks for the suggestion, @jsetzer. Added to our backlog now :)
:idea: AppGini plugins to add more power to your apps:
  • DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
  • Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
  • Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.

Post Reply