Jump to content

Search the Community

Showing results for tags 'swiftmailer'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 2 results

  1. Hi, <noob here> The google group for swift mailer is blocked at my work, so i hope I can get some help here as this site is open. I have a PHP site (working fine) on a windows server running PHP over IIS. I have an ASP site working fine (actually 2 of them) on the same windows server using ASP.Net / VB omn IIS. The ASP site can send emails by relaying them to a seperate exchange server. The PHP site at the moment is failing to send emails. As the ASP site can send emsils I know thatThe userid and password being used is correct The IP of the exchange server is correct All required ports etc are open as it works on ASP I installed SwiftMailer and have the following test page code ... I tried attempt 1 first, but that didn't work. So i tried attempt 2 (all code from manual) but again the 500 error. If I comment out the $mailer->send() lines the page renders normally, so it is failing on the send command. I suspect I have a config issue, can someone suggest what to look at please? Thanks - GC "500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed." <?PHP require_once("../Swift-4.3.0/lib/swift_required.php"); // Create the Transport $transport = Swift_SmtpTransport::newInstance('xx.xx.xx.xx', 25) ->setUsername('uuuuuuuuu') ->setPassword('ppppppppp') ; // Create the Mailer using your created Transport $mailer = Swift_Mailer::newInstance($transport); // Or to use the Echo Logger $logger = new Swift_Plugins_Loggers_EchoLogger(); $mailer->registerPlugin(new Swift_Plugins_LoggerPlugin($logger)); // Create a message $message = Swift_Message::newInstance('Test Swift subject') ->setFrom(array('from.user@our.com' => 'From me')) ->setTo(array('to.user1@our.com' => 'To Them','to.user2@our.com' => 'Other User')) ->setBody('Here is the message body itself') ; /* // Attempt 1 // Send the message $result = $mailer->send($message); echo "result=[$result]<br />"; */ // Attempt 2 // Pass a variable name to the send() method if (!$mailer->send($message, $failures)) { echo "Failures:"; print_r($failures); } echo function_exists('proc_open') ? "Yep, that will work" : "Sorry, that won't work"; ?>
  2. SwiftMailer's function to set the recipient's email and name looks like this: setTo(<address>, <name>); This works dandy, unless a recipient has parenthesis (maybe other characters, but for my purpose is irrelevant). Examples: John (Work) John (Home) In my use case, th data in parenthesis is important for the recipient to derive the intent of the email notification. SwiftMailer will truncate any data in parens leaving behind "John " in both scenarios. Esacaping the parens with a backslash John \(Work\) alleviates the parens replacement, but includes an automatic escaping of the escape lol: John \\(Work\\) Reading into the headers sent with SM, there are several other headers that have parens in them, so I don't believe this is done for that purpose - but I could be wrong. So my Q is two part: Is there a way to send parens in the recipient's name? and is there a reason this is done at all? Cheers
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.