1
votes

I have ftp access to a server which hosts a web site made with typo3. The web site in typo3 has a contact form somewhere, but I don't have any specifics, for I am not a typo3 developer at all.

I now want to add to that very server a simple service that takes POSTed form data and generates a mail. I have tried a very simple PHP script:

<?php
mail("[email protected]", "Bug report", "A new bug report was submitted: " + json_encode($_POST));
echo("<html><head><title>Thank you for your report</title>...
...
?>

The rest of the script works (it is executed and echo outputs the correct HTML based on the locale), but the mail isn't sent out. I found that the php mail function is unreliable, so I decided to find another way.

  • How can I find out how typo3 sends its mails?
  • Can I use typo3 code to send mails, and if yes, which scripts do I have to import?
  • Could I possibly destroy anything in the typo3 web site by importing typo3 scripts into my script?
1

1 Answers

2
votes

TYPO3 uses SwiftMailer to send mails. You can find it in the contrib directory (the place of this directory depends on which TYPO3 version you use). TYPO3 only adds a wrapper class to use the mailtransport configuration (mbox, mail(), sendmail, SMTP) which can be set in the Install Tool. You can use SwiftMailer in your own code, but you have to use your own configuration.