Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6955149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:41:57+00:00 2026-05-27T14:41:57+00:00

Do you know if it is posible to set a DSN communication using the

  • 0

Do you know if it is posible to set a DSN communication using the Pear Mail function in PHP?

Explain:
If a write this code in a telnet session:

telnet smtp.example.com 25
[...]
mail from: me@example.com
250 2.1.0 Ok
rcpt to: you@fakemail.com NOTIFY=SUCCESS,FAILURE,DELAY ORCPT=rfc822;you@fakemail.com
250 2.1.5 Ok
[]

i received a notification mail with a status code from the receiver smtp server (relayed, failed, etc.) when my smpt server sends the email. Now i want to do the same using Pear Mail, but I can’t find where i have tu put this option.

This is my code:

$messageTEXT= "..." // text_message
$messageHTML="..." // html message

$headers=array();
$headers['From'] = "me@example.com";
$headers['To'] = "you@fakemail.com";
$headers['Subject'] = "Test mail"; 
$headers['X-Mailer']="My PHP mailer";
$headers['X-Priority']=3;
$headers['Errors-To'] = "me@example.com";
$headers['Return-Path'] = "me@example.com";
$headers['Disposition-Notification-To'] =  "me@example.com";

$message = new Mail_mime();
$message->setTXTBody($messageTEXT);
$message->setHTMLBody($messageHTML);

$mimeparams=array();
$mimeparams['charset']= "UTF-8";
$mimeparams['text_encoding']="8bit";
$mimeparams['text_charset']="UTF-8";
$mimeparams['html_charset']="UTF-8";

$body = $message->get($mimeparams);

$headers = $message->headers($headers);

$smtp = Mail::factory(
   'smtp', 
    array(
        'host' => "smtp.example.com", 
        'port' => "25", 
        'auth' => true, 
        'username' => "myuser", 
        'password' => "mypass")
);

$mail=$smtp->send($to, $headers, $body);

if (PEAR::isError($mail)) {
    print ("Error");
    return false;
}

http://pear.php.net/manual/en/package.mail.mail.php

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:41:57+00:00Added an answer on May 27, 2026 at 2:41 pm

    You will have to hack PEAR::Mail and Net::SMTP a bit to get this to work.

    The standard Mail_smtp::send() method calls into Mail_RFC822::parseAddressList() which will reject the extra data. Commenting out those lines (around line 274) should get you started.

    Then you’ll need to hack Net_SMTP::rcptTo() to pass the raw data rather than wrapping it in angle brackets.

    Make sure your data is being sanitized somewhere else if you’re going to circumvent those methods.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code errors: <cfdbinfo datasource=#Application.DSN# name=getCols type=columns table=#this.tableName#> <cftry> <cfquery name=getColumnDetails dbtype=query> SELECT
Is it possible to set breakpoints using the google chrome inspector on javascript code
Is this possible to set different textSize in one TextView? I know that I
I know it is possible to set the current folder of the OpenFolderDialog to
Does anyone know if its possible to set the amount of memory available in
Hey i dont know if that is possible but i want to set a
I know its possible to open an app from mobile safari using custom URL
I know it is possible to set the height of all rows in a
anyone know if its possible to set cflags/linker flags different for simulator vs device
I am using log4j for one of my projects and I know it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.