No Such User Here error when sending via form - php

I have an online form that is being sent to my client's email. Unfortunately I am getting a "No Such User Here" error when submitted. If I test out the form on my email or my coworker's email, it works fine.
The email exists because they have told me they use it to send and receive other email.
Error looks like this:
This message was created automatically by mail delivery software.
A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
<client's email>
No Such User Here
Edit: For what it's worth, here's my code. I'm using Processwire and using the Form Template Processor module. Which I've used before. This form works perfectly when sent to any email but my client's. I'm thinking this is more of an MX records thing which I'm not super well-versed in.
<?php
$form = $modules->get('FormTemplateProcessor');
$form->template = $templates->get('form'); // required
$form->requiredFields = array('first_name','last_name','company','email','phone');
$form->email = 'CLIENTS EMAIL'; // optional, sends form as email
$form->parent = $page; // optional, saves form as page
echo '<div class="form-header"><h2>Become a member today</h2></div>';
echo $form->render(); // draw form or process submitted form
?>

There are several reasons why you would get a "550 No Such User Here" error.
Mail file permissions are not readable or are incorrect.
The email address was typed incorrectly.
MX records are incorrect ( pointing to the wrong server ).
Email does not route correctly ( Remote / Local domains ).
To dig further kindly go through this article Source
Credits to the Source Poster #James Richardson

Related

openssl_decrypt with aes-192-ctr return �L�� ��&A�C��

I build a function to encrypt and decrypt an e-mail address to append it as a get param to an URL in the content of the e-mail.
When the recipient is clicking on the link in the email it should decrypt the get param so my site could work with this data again. I'm not allowed by different laws to save it till the user hasn't accepted the email.
so my code is working like this....
User is filling a form which posts the data to my function
SECURITY_SALT = "218391"; // just example salt
$email = $_POST['email'];
$getParamToAppend = openssl_encrypt($email, "aes-192-ctr", SECURITY_SALT);
sendMail($email, $getParamToAppend);
When the user is opening the URL of the mail it should decrypt and use this data again.
SECURITY_SALT = "218391"; // just example salt
$email = $_GET['email'];
$emailDecrypted = openssl_decrypt($email, "aes-192-ctr", SECURITY_SALT);
doMyStuff(emailDecrypted);
Now I'm receiving when I'm opening the URL out my Phone(Gmail) or a mail-client( https://de.tobit.software/david ) a result like this:
myname#gma�L�� ��&A�C�� (gmail.com)
myname#compan�L�� ��&A�C�� (david + 1&1 email address)
But when I'm opening the site with a 1&1 e-mail address via webmailer of my company I'm receiving
myname#company.com
any ideas how to solve my problem?
tried till now different "solutions"
utf8_decode/utf8_encode
changing apache charset config
different browsers
but nothing seems to work...
Additional Information: I'm using phpmailer and also set the Charset option to UTF-8 there.
Solved my issue by using this dope shit. ^^
before sending the e-mail
$getParamToAppend = openssl_encrypt(urlencode($email), "aes-192-ctr", SECURITY_SALT);
when clicking on the link
$emailDecrypted = openssl_decrypt(urldecode($email), "aes-192-ctr", SECURITY_SALT);

Oscommerce Mail does not send for concatenated string

hi am new to oscommerce plat form,i have a task i.e once user check the mail means it will send to the user email address and admin email address else it will send mail to admin.the problem is here,once i did the condition means it wont send the mail for concatenate string.
My code is given below:
VARIABLE NAME:email_address=tep_db_prepare_input(HTTP_POST_VARS['email']);
tep_mail(STORE_OWNER,emailaddres."xxyt#somemail.com",EMAIL_SUBJECT,subject,message,name, email_address);
tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
here i want send the mail to user also.
HTTP_POST_VARS['email'] needs Register Globals to be on which in most servers these days is off( as its a security threat).
echo HTTP_POST_VARS['email'] and check are you getting some value or not else use $_POST['email']

Need confirmation for contact form to show in same place, not a separate page?

For example, if they didn't enter an email address, then this opens in a new window, but I need it in the same window. Current code:
// Error message displays if email is missing
if (!$from){$errorMes3="ERROR: You didn't enter your email address. "; $error=1; }
Also, success message needs to be in same box and redirect to same page, Current code:
// display mail sent message
else {
echo (" <title>SendMail Notice: mail was successfully sent</title><body><br><br><br><br>
<p style=\"font:11pt arial\" align=left>Your message has been successfully sent.
<br><br><i>Thank you</i></p>
</body></html>"); exit(0);
I used a contact form where it was already integrated and that solved the problem. works great now!
try with form action $_SERVER['PHP_SELF'] and for the error & success messages you need to check the validations on the same page.

How to create a script that users can specify an email and send a user a pre-defined email?

So, basically, I'm creating a page where a user can visit, and enter in the following information:
1. Their First Name
2. Their Email
3. Recipient's Email
They then can send a pre-defined email, saying something like the following...
"Hello, {Recipient's email}. {First name} ({Email}) has just sent you a slurp! You can ignore this message, or slurp them back.
[Slurp Them Back] [Slurp Someone Else] [What's A Slurp?]"
The whole part about the Slurp is something that doesn't really matter, it's just the text from the pre-defined email. The text in {...} is taken from the fields on the page, and the text in [...] are just links.
Does anyone have any idea on how to do this? Even if you can't customize the email, and it would just be without the information from the site, help would be appreciated. Thanks.!
Here's an example of what I'm going for...
Example Layout
It's possible to do using the php mail function. You can take input for everything you specified, then use the example here. They show it in a basic and more advanced form.
Interestingly, the first chapter of Head First PHP describes almost exactly this scenario (except that the recipient is fixed). If you want to learn more about PHP you can look into the book; otherwise, their code is online at http://www.headfirstlabs.com/books/hfphp/ (actual code link: http://www.headfirstlabs.com/books/hfphp/code/HeadFirstPHPMySQL_code_ch01.zip)
Sending an email by itself can be done by using the mail() command
mail('to.address#host.com', 'subject', 'message', 'From: from.address#host.com');
The whole code would look something like this:
HTML:
<form action="slurping.php" method="post">
Your name: <input type="text" name="name" /><br />
Your email: <input type="text" name="email" /><br />
Recipient: <input type="text" name="recipient" /><br />
<input type="submit" />
</form>
PHP (slurp.php):
// order of parameters is: to, subject, message body, additional headers
mail(
$_POST['recipient'],
'You just got slurped',
'You\'ve been slurped by '.$_POST['name'].'. Slurp him/her back by visiting http://slurp.com/',
"From: {$_POST['email']}\r\n"
);
This will send out an email like it's coming from the senders email address to the recipient.
There's a lot missing there, though. What you normally want to include is:
Validation of input on the client side (javascript)
Validation of input on the serverside
Clear out and handle right encodings etc
If you want to do it properly however, so that a greater percentage of your users actually receive the email, you should use a 3rd party library to send out emails. I recommend PHP Mailer or Swift Mailer.
Those libraries provide an easy mechanism for you to include HTML in your emails, attachments, allow for easily connecting to SMTP servers and handle all escaping and encoding issues for you.
On top of that they encapsulate everything within an Object oriented approach, so if that's your cup of tea, you'll be happy. Se their websites for more info.
It's pretty funny, I wrote a blog post about the very issue of email deliverability (getting through spam filters) etc: http://arnorhs.com/2011/02/21/delivering-email-with-php/ - It might be helpful to you.
Cheers
On submit you can send a predefine email in php
following is the code sample
assumed that you will have a html page and following is the sample html code
Send Slurp
Enter Your Name:
Enter Your Email:
Enter Recipient's Email:
following is the php code in "="send_email.php"
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
$your_name = $_POST['your_name'];
$your_email = $_POST['your_email'];
$recipients_email= $_POST['recipient_email'];
$email_subject = 'My Slurp';
$email_body = "Hello, $recipients_email. $your_name ($your_email) has just sent you a slurp! You can ignore this message, or slurp them back.
[Slurp Them Back] [Slurp Someone Else] [What's A Slurp?]";
echo $email_body;
// Send Email
mail($recipients_email, $email_subject, $email_body);
}
?>

formmail to email in database

Here's what I need to setup...and I am not well versed in PHP/SQL...but this is what I'm trying to do.
On the New User database, I will have a section where they can have information sent to their phone using the provider's default e-mail to text msg (i.e. 2225551212#txt.att.net.)
New User:
Input number: ______________(2225551212 format, no hyphens, etc.)
Select Provider: (Drop-down menu with proper #provider.ext...)
Then the formmail, when sent, if for specific user will get ($phone".#."$provider); or something like that and send a preset message like:
$user."requested information on ".$product."on".$date." at ".$time.".";
Is this possible?
The $user, $product, $date, $time all are generated directly from the most recent input page for a database.
Is this possible?
Please help!
Assuming your question is "can I send a text message from PHP", then yes; if the server where you are running PHP is configured to send email, then within PHP you can try:
mail('2225551212#txt.att.net', 'New User', $user."requested information on ".$product."on".$date." at ".$time.".");
For more help with the mail() function, check out http://php.net/mail .

Categories