samp.directory
← Skripte und Bibliotheken

aujiz11/samp-mail-include

Includes an API that allows you to send HTTP requests to send emails to players.

Bibliothek★ 1aktualisiert Feb. 2025Keine LizenzPawnsampctl
Auf GitHub öffnen

Dieses Repository hat keine Lizenzdatei. Es ist öffentlich lesbar, aber das allein gibt noch keine Erlaubnis, es weiterzuverwenden.

Mit sampctl installieren

sampctl package install aujiz11/samp-mail-include

Führe das in deinem Projektordner aus. sampctl lädt das Paket und alles herunter, wovon es abhängt.

Im Pawn-Compiler ausprobieren →

Fügt seine Include-Dateien samt der Bibliotheken, von denen es abhängt, dem Pawn-Compiler in deinem Browser hinzu, bereit zum Einbinden in ein Skript.

README.md

samp-mail-include

Installation

Simply install to your project:

sampctl package install aujiz11/samp-mail-include

Include in your code and begin using the library:

#include <mail>

Important:

You need to put mail.php in the host then define the URL leading to it in the game script!

Usage

The main function for sending emails is Mail_Send. Here's the function syntax and parameters:

Mail_Send(playerid, const function[], const to[], const additional_headers[], const subject[], const message[], type = MAIL_TYPE_NORMAL)

Parameters

  • playerid: The ID of the player sending the email
  • function[]: Callback function name that will be called when the email is sent
  • to[]: Recipient's email address
  • additional_headers[]: Additional email headers (optional)
  • subject[]: Email subject line
  • message[]: Email body content
  • type: Email type (default: MAIL_TYPE_NORMAL)
    • MAIL_TYPE_NORMAL: Plain text email
    • MAIL_TYPE_HTML: HTML formatted email

Example Usage

public OnPlayerConnect(playerid)
{
	Mail_Send(playerid, Mail:MAIL_FUNC, "[email protected]", "MAIL Name", "Send Mail Test", "Test");
}

Mail_Response:MAIL_FUNC(playerid, response_code, const data[]) {
	switch (response_code) {
        case 200: {
            // success
        }
        default: {
            // error
        }
    }

	printf(data);
}

Testing

To test, simply run the package:

sampctl package run

Diese Seite wird aus dem erstellt, was GitHub über das Repository veröffentlicht. samp.directory hostet den Code nicht. Ein Problem mit diesem Eintrag melden